Enable /nginx_status

Please how do I enable /nginx_status for localhost? I tried adding it to /etc/nginx/xx.xx.xx.conf , but it doesn’t work.

location /nginx_status {
                stub_status on;
                access_log off;
                allow localhost;  
                deny all;
               }

Nginx by default not listen in local IP

In your settings localhost isnt valid directive, you need add IP not a host

So

Change allow localhost; for

allow YOUR_SERVER_IP;
YOUR_SERVER_IP = your main server IP

Restart nginx and try curl SERVER_IP/nginx_status

SERVER_IP = IP in /etc/nginx/xx.xx.xx.conf

Try port 8084 instead…