簡體   English   中英

Nginx 添加模塊 = 怎么做?

[英]Nginx add modules = how to?

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

所以我需要下載一些東西嗎? 並把它放在這個目錄中?

也可以使用此模塊將圖像推送給用戶? 意味着他會去網站並會在他的網頁中看到我的圖片\\圖標? 還是我需要另一個模塊?

謝謝,

假設這是關於 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 文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM