Get the App
SLTechnology News&Howtos  ›  Servers  › 

Nginx is the method of dynamically adding modules to installed nginx.

Shulou Source: shulou.com Published: 2022-06-02 03:49:21 10月01日 Update

Description:

If you have already installed nginx, you need to add a module that has not been compiled and installed. What do you need to do?

Specific:

Here, take the installation of the third-party NGX _ http_google_filter_module module as an example

The module of nginx needs to recompile nginx instead of referencing .so in the configuration file like apache.

1. Download the third-party expansion module ngx_http_google_filter_module

# cd / data/software/# git clone https://github.com/cuber/ngx_http_google_filter_module

two。 See which modules are installed when nginx is compiled and installed

# nginx-Vnginx version: nginx/1.8.0built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) built with OpenSSL 1.0.1e-fips 11 Feb 2013TLS SNI support enabledconfigure arguments:-- prefix=/usr/local/nginx-- with-http_ssl_module-- with-http_sub_module-- with-http_gzip_static_module-- with-http_stub_status_module-- add-module=/data/software/ngx_http_substitutions_filter_module

You can see that the compilation installation uses these parameters-- prefix=/usr/local/nginx-- with-http_ssl_module-- with-http_sub_module-- with-http_gzip_static_module-- with-http_stub_status_module-- add-module=/data/software/ngx_http_substitutions_filter_module. -- add-module=/data/software/ngx_http_substitutions_filter_module is added when the ngx_http_substitutions_filter_module module was added before compilation

3. Add the modules that need to be installed and recompile, as add-add-module=/data/software/ngx_http_google_filter_module here

#. / configure-- prefix=/usr/local/nginx-- with-http_ssl_module-- with-http_sub_module-- with-http_gzip_static_module-- with-http_stub_status_module-- add-module=/data/software/ngx_http_substitutions_filter_module-- add-module=/data/software/ngx_http_google_filter_module# make / / Don't make install, otherwise it will really be covered

4. Replace the nginx binaries:

# cp / usr/local/nginx/sbin/nginx / usr/local/nginx/sbin/nginx.bak# cp. / objs/nginx / usr/local/nginx/sbin/

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

Tags: Module compilation file third party binary content parameter that is install learn help support configure dynamic method Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS MariaDB Apple Shulou Information