Ubuntu bionic に ngx_http_limit_req_module nginx モジュールをインストールして有効にする方法

Ubuntu bionic に ngx_http_limit_req_module nginx モジュールをインストールして有効にする方法

ngx_http_limit_req_moduleUbuntu Bionic に nginx をインストールする必要があります。

設定例はどこにでも見つかりますが、インストール方法や、これをビルド済みモジュールとして入手する方法が見つかりません。gitlab のソースを見ると、ディレクトリ内に見つかりますmodules/が、実行するとnginx -Vそこにはありません。nginx-stable ( ) の指定されたリポジトリも使用していますhttps://nginx.org/packages/ubuntu/ bionic nginxが、デフォルトの bionic リポジトリの nginx パッケージの方が好みです。

私は nginx エコシステムについてはまったくの初心者なので、助けていただければ幸いです。

それとも、すでにコンパイルされていて、誰にとっても(私以外)明らかなので、実行時に表示されないのでしょうかnginx -V

よろしくお願いします :)

答え1

試してみましたが、すぐに使えます。少なくとも、Ubuntu Bionic リポジトリのプレーンな nginx パッケージ (nginx-full や nginx-extras ではなく、これらも動作するはず) では使えます。nginx のバージョンは です1.14.0

の出力nginx -V

nginx version: nginx/1.14.0 (Ubuntu)
built with OpenSSL 1.1.1  11 Sep 2018
TLS SNI support enabled
configure arguments: --with-cc-opt='-g -O2 
-fdebug-prefix-map=/build/nginx-GkiujU/nginx-1.14.0=. 
-fstack-protector-strong -Wformat -Werror=format-security 
-fPIC -Wdate-time -D_FORTIFY_SOURCE=2' 
--with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fPIC' 
--prefix=/usr/share/nginx 
--conf-path=/etc/nginx/nginx.conf 
--http-log-path=/var/log/nginx/access.log 
--error-log-path=/var/log/nginx/error.log 
--lock-path=/var/lock/nginx.lock 
--pid-path=/run/nginx.pid 
--modules-path=/usr/lib/nginx/modules 
--http-client-body-temp-path=/var/lib/nginx/body 
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi 
--http-proxy-temp-path=/var/lib/nginx/proxy 
--http-scgi-temp-path=/var/lib/nginx/scgi 
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi 
--with-debug --with-pcre-jit 
--with-http_ssl_module 
--with-http_stub_status_module 
--with-http_realip_module 
--with-http_auth_request_module 
--with-http_v2_module 
--with-http_dav_module 
--with-http_slice_module 
--with-threads 
--with-http_addition_module 
--with-http_geoip_module=dynamic 
--with-http_gunzip_module 
--with-http_gzip_static_module 
--with-http_image_filter_module=dynamic 
--with-http_sub_module 
--with-http_xslt_module=dynamic 
--with-stream=dynamic 
--with-stream_ssl_module 
--with-mail=dynamic 
--with-mail_ssl_module

つまり、兆候はなく、モジュール ディレクトリにngx_http_limit_req_moduleもファイルはありませんが、動作しています。つまり、何らかの形で nginx のコアにあることがわかります。.so

たとえば、ngx_http_geoip_module.cnginxのソースのモジュールディレクトリに次のものがあります(Githubのミラー:https://github.com/nginx/nginx/tree/master/src/http/modules) があり、上記のように指定する必要があります。ただし、同じディレクトリにはモジュールもありngx_http_limit_req_module.c、それを指定する必要はありません...そのため、nginx を構成するときにどのモジュールを指定する必要があるのか​​まったく不明です。

おそらく、これは誰かが研究に費やす時間を節約するのに役立つでしょう。

乾杯!

関連情報