nginxの基礎:3:確認方法三者モジュール

ここに画像を挿入説明
nginxのは、デフォルトのモジュールに起因している多くの有用な特徴は、道が含まれていない地域社会の三者モジュールの提供をたくさん持っていることが多いsubs_filterの例には、この記事の目的を達成するためにソースコードをコンパイルするために必要とされる、最初のを教えて確認方法の三者モジュール。

subs_filterモジュール

URLを交換するためのsubs_filter手段は、転送を実行するプロセスは、より一般的に使用されています。構成ファイルで設定は次のように一般的です。

subs_filter www.待替换的内容 [mirror_host_name];
subs_filter https:// http://;

それはモジュールが含まれていること

方法1:使用nginxの-V

[root@liumiaocn nginx]# nginx -V
nginx version: nginx/1.16.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/run/nginx.pid --lock-path=/run/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-stream_ssl_preread_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-http_auth_request_module --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-google_perftools_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic' --with-ld-opt='-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-E'
[root@liumiaocn nginx]# 

それは適切なモジュールが含まれていることを確認し、直接コマンドを確認するために使用することができます

[root@liumiaocn nginx]# nginx -V 2>&1 |grep subs_filter
[root@liumiaocn nginx]# 

以上がCentOSのYUMに装着nginxのデフォルトを使用して、存在しないログの一例であり、モジュールがインストールされません。

方法2:確認は/ usr / lib64に/ nginxの/モジュールディレクトリ

/ usr / lib64に/ nginxの/ modulesディレクトリには、モジュールを構成成分は、このディレクトリに対応するファイルがそうチェックすることができるかどうかを確認するために、ファイルそれほどの形で存在し、一般的になり、nginxの-Vインストールディレクトリモジュールを得ています

[root@liumiaocn nginx]# ls /usr/lib64/nginx/modules
ngx_http_image_filter_module.so  ngx_http_perl_module.so  ngx_http_xslt_filter_module.so  ngx_mail_module.so  ngx_stream_module.so
[root@liumiaocn nginx]# 

方法3:nginxのプロファイルによって決定されます

このよう次の文のように、段落nginxの設定ファイルで文を置き換えるために場所を追加します。http HTTPSを置き換え話します

subs_filter https:// http://;

そして、それ以外の場合は、次のログ情報と同様促すメッセージが表示されます、あなたは、このモジュールを持っている場合、あなたが通常行うことができ、負荷にnginxの-sリロードを行います

[root@liumiaocn nginx]# nginx -s reload
nginx: [emerg] unknown directive "subs_filter" in /etc/nginx/nginx.conf:53
[root@liumiaocn nginx]# 

別の例は、次の例です:

          subs_filter  http://www.google.com http://IP地址;
          subs_filter  https://www.google.com http://IP地址;

概要

この記事では、次のソースコードと設定をコンパイルする方法をご紹介していきますnginxの中に三者のモジュールを確認する方法について説明します。

リリース1028元の記事 ウォンの賞賛1290 ビュー398万+

おすすめ

転載: blog.csdn.net/liumiaocn/article/details/104104790