在 Debian 10 上安装 Nginx-extras 模块,将 nginx-1.20 降级到 1.14

在 Debian 10 上安装 Nginx-extras 模块,将 nginx-1.20 降级到 1.14

我已经按照以下步骤在 Debian 10 上安装了 Nginx 1.20:

Debian 上的 Nginx

我需要安装Nginx-extras,但sudo apt-get install -y nginx-extras 检查后Nginx -v它返回 1.14.2...(在 Ubuntu 20 中它从 1.20 降级到 1.18)

更多信息:当我使用默认存储库在 Debian 上安装 Nginx 时,将安装版本 1.14.2。在我的.conf文件中,我需要delay像这样使用:

limit_req zone=server_ratelimit burst=800 delay=500;

,因此出现错误:

此版本(1.14)不支持delay

因此,我清除了 Nginx 并安装了 1.20 版本。现在添加一些指令,我需要安装Nginx-extras,安装此模块后,当我检查 Nginx 版本时,它显示 1.14,但delay没有抛出任何错误,这意味着版本不是 1.14?!

我需要知道我的 Nginx 的真实版本是什么?如果是 1.14,那为什么delay没有抛出错误?如果是 1.20,为什么Nginx -v返回 1.14?

更新 1

apt-cache show nginx-extras Package:返回:

Package: nginx-extras
Source: nginx
Version: 1.14.2-2+deb10u3
Installed-Size: 1277
Maintainer: Debian Nginx Maintainers <[email protected]>
Architecture: amd64
Provides: httpd, httpd-cgi, nginx
Depends: libnginx-mod-http-auth-pam (= 1.14.2-2+deb10u3), libnginx-mod-http-cache-purge (= 1.14.2-2+deb10u3), libnginx-mod-http-dav-ext (= 1.14.2-2+deb10u3), libnginx-mod-http-echo (= 1.14.2-2+deb10u3), libnginx-mod-http-fancyindex (= 1.14.2-2+deb10u3), libnginx-mod-http-geoip (= 1.14.2-2+deb10u3), libnginx-mod-http-headers-more-filter (= 1.14.2-2+deb10u3), libnginx-mod-http-image-filter (= 1.14.2-2+deb10u3), libnginx-mod-http-lua (= 1.14.2-2+deb10u3), libnginx-mod-http-perl (= 1.14.2-2+deb10u3), libnginx-mod-http-subs-filter (= 1.14.2-2+deb10u3), libnginx-mod-http-uploadprogress (= 1.14.2-2+deb10u3), libnginx-mod-http-upstream-fair (= 1.14.2-2+deb10u3), libnginx-mod-http-xslt-filter (= 1.14.2-2+deb10u3), libnginx-mod-mail (= 1.14.2-2+deb10u3), libnginx-mod-nchan (= 1.14.2-2+deb10u3), libnginx-mod-stream (= 1.14.2-2+deb10u3), nginx-common (= 1.14.2-2+deb10u3), libc6 (>= 2.28), libpcre3, libssl1.1 (>= 1.1.0), zlib1g (>= 1:1.1.4)
Suggests: nginx-doc (= 1.14.2-2+deb10u3)
Conflicts: nginx-full, nginx-light
Breaks: nginx (<< 1.4.5-1)
Description-en: nginx web/proxy server (extended version)
 Nginx ("engine X") is a high-performance web and reverse proxy server
 created by Igor Sysoev. It can be used both as a standalone web server
 and as a proxy to reduce the load on back-end HTTP or mail servers.
 .
 This package provides a version of nginx with the standard modules, plus
 extra features and modules such as the Perl module, which allows the
 addition of Perl in configuration files.
 .
 STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Empty
 GIF, FastCGI, Geo, Limit Connections, Limit Requests, Map, Memcached, Proxy,
 Referer, Rewrite, SCGI, Split Clients, UWSGI.
 .
 OPTIONAL HTTP MODULES: Addition, Auth Request, Charset, WebDAV, FLV, GeoIP,
 Gunzip, Gzip, Gzip Precompression, Headers, HTTP/2, Image Filter, Index, Log,
 MP4, Embedded Perl, Random Index, Real IP, Slice, Secure Link, SSI, SSL,
 Stream, SSL Preread, Stub Status, Substitution, Thread Pool, Upstream,
 User ID, XSLT.
 .
 MAIL MODULES: Mail Core, Auth HTTP, Proxy, SSL, IMAP, POP3, SMTP.
 .
 THIRD PARTY MODULES: Auth PAM, Cache Purge, DAV Ext, Echo, Fancy Index,
 Headers More, Embedded Lua, HTTP Substitutions, Nchan, Upload Progress,
 Upstream Fair Queue.
Description-md5: 225aac32714dab461692d2628eac8f17
Homepage: https://nginx.net
Section: httpd
Priority: optional
Filename: pool/main/n/nginx/nginx-extras_1.14.2-2+deb10u3_amd64.deb
Size: 515148
MD5sum: 63868ff73f9ea92b604394fb2b793be2
SHA256: bc67168fb3a20bda1d9c50fc56a65dbeb04da9cd8046faac2e0bead1f6035e81

dpkg -s nginx-extras | grep '^Version:'返回:

版本:1.14.2-2+deb10u3

值得注意的是,安装后sudo apt-get install -y nginx-extras,在 Debian 10(不是 Ubuntu)上仍然出现错误:

/etc/nginx/nginx.conf:53 中的未知指令“more_set_headers”

更新-2: cat /etc/apt/sources.list.d/nginx.list返回:

德布http://nginx.org/packages/debian破坏者 nginx

答案1

如果你想使用nginx 安装页面

nginx-extras 1.14 包来自 debian 的基础 repo。

您可以像这样安装单独的模块:

apt-get install libnginx-mod-http-headers-more-filter

相关内容