Nginx line smoothing add new modules; such as (--with-http_realip_module)

nginx add modules
1. Check the current nginx information (profile path, the user starts ...)

ps aux | grep nginx

 

 

2. Check the module (module recording information, the installation path) of the current nginx enabled
./nginx -V

 

 3. official website to download the corresponding version of nginx source package (http://nginx.org/)

http://nginx.org/en/download.html

 

 

4. Compile uploaded to the server unzip

--with-http_realip_module nginx is built-in module, the case of third-party modules to download, and follow the corresponding version mismatch problems

Add a new module compiled on the basis of the original modules:

 

 After compile, make; make install remember not to reinstall

Nginx original backup file:

 

 

 

The new nginx compiled files used to replace:

 

 

 Check after replacing nginx modules:

 

Nginx reload the module to take effect:

 

 

 

Note: If the third party modules, by downloading the corresponding third-party modules (note that matches the version of nginx) as (ngx_pagespeed-master); decompress the corresponding directory, the translation of the new --add-module = / directory corresponding to / ngx_pagespeed-master; as follows:

./configure --prefix=/apprun/nginx --with-http_ssl_module --with-http_v2_module --with-http_dav_module --with-http_stub_status_module --with-threads --with-file-aio --with-stream --with-stream_ssl_module --with-pcre --with-http_slice_module --with-http_realip_module --add-module=/usr/local/ngx_pagespeed-master

Guess you like

Origin www.cnblogs.com/NGames/p/12078503.html