Written in front
Dynamically add modules to Nginx Here we take the installation of the third-party ngx_http_google_filter_module module as an example. Nginx modules require recompiling Nginx, rather than referencing .so in the configuration file like Apache. Download the third-party extension module ngx_http_google_filter_module # cd /data/software/ # git clone https://github.com/cuber/ngx_http_google_filter_module Check which modules are installed when nginx is compiled and installed Switch the command line to the directory where the Nginx execution program is located and enter ./nginx -V, as follows: [root@binghe sbin]# ./nginx -V nginx version: nginx/1.19.1 built by gcc 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC) built with OpenSSL 1.0.2 22 Jan 2015 TLS SNI support enabled configure arguments: --prefix=/usr/local/nginx-1.19.1 --with-openssl=/usr/local/src/openssl-1.0.2 --with-pcre=/usr/local/src/pcre-8.37 --with-zlib=/usr/local/src/zlib-1.2.8 --with-http_ssl_module [root@binghe sbin]# It can be seen that the parameters used to compile and install Nginx are as follows: --prefix=/usr/local/nginx-1.19.1 --with-openssl=/usr/local/src/openssl-1.0.2 --with-pcre=/usr/local/src/pcre-8.37 --with-zlib=/usr/local/src/zlib-1.2.8 --with-http_ssl_module Add the modules that need to be installed and recompile Add here --add-module=/data/software/ngx_http_google_filter_module The details are as follows: ./configure --prefix=/usr/local/nginx-1.19.1 --with-openssl=/usr/local/src/openssl-1.0.2 --with-pcre=/usr/local/src/pcre-8.37 --with-zlib=/usr/local/src/zlib-1.2.8 --with-http_ssl_module -–add-module=/data/software/ngx_http_google_filter_module As above, add all the parameters of Nginx installed previously, and finally add --add-module=/data/software/ngx_http_google_filter_module After that, we need to compile as follows: # make //Don't make install, otherwise it will be overwritten Here, it is important to note that: do not execute the make install command. Replace nginx binary # Back up the original nginx execution program# mv /usr/local/nginx-1.19.1/sbin/nginx /usr/local/nginx-1.19.1/sbin/nginx.bak # Copy the newly compiled nginx executable program to the /usr/local/nginx-1.19.1/sbin/directory# cp /opt/nginx/sbin/nginx /usr/local/nginx-1.19.1/sbin/ Okay, let’s stop here for today! Don’t forget to like, follow and forward so that more people can see it, learn and improve together! ! The above is the detailed content of the method of dynamically adding modules to Nginx. For more information about dynamically adding modules to Nginx, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: How to elegantly implement WeChat authorized login in Vue3 project
>>: Detailed introduction to Mysql date query
Tips: Array change method will cause v-for to upd...
Table of contents Preface 1. Install NJS module M...
Table of contents Slots What are slots? Slot Cont...
1. Background The company's projects have alw...
Convert code to image using html2canvas is a very...
need: Merge identical items of one field and sort...
environment: 1 CentOS Linux release 7.5.1804 (Cor...
Win10 installs mysql5.7 decompressed version, for...
Table of contents 1. Get request: 2. Post request...
Table of contents Introduction to stored procedur...
Table of contents status quo Solution Further sol...
Official documentation: So mysql should be starte...
Table of contents 1. The origin of tomcat 1. Tomc...
This article shares the specific code for the WeC...
//Default protocol /The use of the default protoc...