Tags: nginx add module

Enable status module [–with-http_stub_status_module]

nginxWhat happens when you find that some of the modules you need are not installed in subsequent use after installation?

To the nginx source directory, recompile, but do not make install.

Specific steps:

# cd /home/nginx-1.6.3

# ./configure –prefix=/usr/local/nginx –with-openssl=/home/openssl –with-zlib=/home/zlib-1.2.8 –with-pcre=/home/pcre-8.35  –with-http_stub_status_module

# make

Never make install, make install will cover the installation.

Proceed with the following operation:

# /usr/local/nginx/sbin/nginx -s stop

Modify the configuration file: add the following options in the configuration file.

# vi /usr/local/nginx/conf/nginx.conf

        location /ngx_status 

        {

        stub_status on;

        access_log off;

        allow 127.0.0.1; #Be sure to add access restrictions.

        allow 192.168.1.42;                #Test machine IP address

        deny all;

        }

# mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx_bak

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

# /usr/local/nginx/sbin/nginx

Now you can see the status of nginx.

curl 192.168.1.42/ngx_status

This article is from the “Notes” blog. Be sure to keep it at http://xiaozuo 2010925.blog.51cto.com/3528655/1892297

Nginx add module

Tags: nginx add module

Original address: http://xiaozuo2010925.blog.51cto.com/3528655/1892297

Similar Posts:

Link of this Article: Nginx add module

Leave a Reply

Your email address will not be published. Required fields are marked *