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
The HTTP request methods specified by the HTTP/1....
I love coding, it makes me happy! Hello everyone,...
This article example shares the specific code of ...
1. Design source code Copy code The code is as fol...
1. Introduction to keepalived Keepalived was orig...
Background requirements: The ERP system needs to ...
Log rotation is a very common function on Linux s...
Clickhouse Introduction ClickHouse is a column-or...
Introduction to temporary tables What is a tempor...
MySQL dynamically modify replication filters Let ...
<br />In the previous article, I introduced ...
When creating a time field DEFAULT CURRENT_TIMEST...
Implementation effect: 1. count(1) and count(*) W...
How can you find the location of the configuratio...