首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装nginx-附加模块,将Debian 10上的nginx-1.20降级为1.14

安装nginx-附加模块,将Debian 10上的nginx-1.20降级为1.14
EN

Server Fault用户
提问于 2021-06-06 04:36:13
回答 1查看 6.9K关注 0票数 1

我在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

代码语言:javascript
复制
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:返回:

代码语言:javascript
复制
Package: nginx-extras
Source: nginx
Version: 1.14.2-2+deb10u3
Installed-Size: 1277
Maintainer: Debian Nginx Maintainers <pkg-nginx-maintainers@alioth-lists.debian.net>
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 10u 3

很高兴知道,在安装sudo apt-get install -y nginx-extras之后,仍然会在Debian 10 (而不是Ubuntu)上出错:

未知指令"more_set_headers“在/etc/nginx/nginx.conf:53中

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

deb http://nginx.org/packages/debian恶飞虱

EN

回答 1

Server Fault用户

发布于 2021-06-06 06:25:34

如果要使用nginx安装页面,则应该使用nginx包而不是附加包。

1.14包的nginx-额外是来自基础回购的debian。

您可以安装如下所示的独立模块:

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

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/1065842

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档