0

我只是在 Oracle linux 上安装 Nginx 并将其用作反向代理。

这是我想要的。

现在我想添加这个模块:

ngx_http_v2_module

我该怎么做呢 ?配置文件在哪里?

我到处看他们说

他的模块不是默认构建的,它应该使用 --with-http_v2_module 配置参数启用。

但我没有看到任何如何做到这一点的例子......

当我进入

/usr/share/nginx/moudles/

我只看到这个文件:

-rw-r--r--. 1 root root 65 Mar 30  2018 mod-http-geoip.conf
-rw-r--r--. 1 root root 72 Mar 30  2018 mod-http-image-filter.conf
-rw-r--r--. 1 root root 64 Mar 30  2018 mod-http-perl.conf
-rw-r--r--. 1 root root 71 Mar 30  2018 mod-http-xslt-filter.conf
-rw-r--r--. 1 root root 59 Mar 30  2018 mod-mail.conf
-rw-r--r--. 1 root root 61 Mar 30  2018 mod-stream.conf

所以我需要下载一些东西吗?并把它放在这个目录中?

也可以使用此模块将图像推送给用户?意思是他会去网站,会在他的网页上看到我的图片\图标?还是我需要另一个模块?

谢谢,

4

1 回答 1

1

假设这是关于 Oracle Linux 7,Oracle 在两个渠道中提供 nginx:

  • 适用于 Oracle Linux 7 的 EPEL 包 (ol7_developer_EPEL)
 # yum info nginx
Loaded plugins: langpacks, ulninfo
Installed Packages
Name        : nginx
Arch        : x86_64
Epoch       : 1
Version     : 1.12.2
Release     : 2.el7
Size        : 1.5 M
Repo        : installed
From repo   : ol7_developer_EPEL
Summary     : A high performance web server and reverse proxy server
URL         : http://nginx.org/
License     : BSD
Description : Nginx is a web server and a reverse proxy server for HTTP, SMTP, POP3 and
            : IMAP protocols, with a strong focus on high concurrency, performance and low
            : memory usage.

它是用 http2 模块编译的:

# /usr/sbin/nginx -V 2>&1 | sed -e 's/--with/\n\0/g' | grep http_v2
--with-http_v2_module 
  • 或者,软件集合库中也有一个版本 (ol7_software_collections)
# yum info rh-nginx114
Loaded plugins: langpacks, ulninfo
Installed Packages
Name        : rh-nginx114
Arch        : x86_64
Version     : 1.14
Release     : 6.el7
Size        : 0.0  
Repo        : installed
From repo   : ol7_software_collections
Summary     : Package that installs rh-nginx114
License     : GPLv2+
Description : This is the main package for rh-nginx114 Software Collection.

我们还支持 http2:

# /opt/rh/rh-nginx114/root/usr/sbin/nginx -V 2>&1 | sed -e 's/--with/\n\0/g' | grep http_v2
--with-http_v2_module 

所以基本上无论你安装了什么版本,你都应该被覆盖。

对于这个模块的配置,你应该查看上游 NGINX 文档

于 2020-03-30T16:06:11.587 回答