Why my NginxStatus do not work?

  1. I had add “–with-http_stub_status_module” when I configure the
    Nginx.

  2. I run “/usr/local/nginx/sbin/nginx -t”, and the test is successful.
    My nginx.conf:

user daemon;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name 192.168.1.140;

    location / {
        root   /home/httpd;
        index  index.html index.htm index.php;
    }
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME 

/home/httpd/$fastcgi_script_name;
include fastcgi_params;
}
location /NginxStatus {
stub_status on;
auth_basic “NginxStatus”;
auth_basic_user_file conf/htpasswd;
}
}
}

  1. I visit http://192.168.1.140, and it is OK.
    But I visit http://192.168.1.140/NginxStatus, it return “403 Forbidden”.

Is my nginx.conf wrong? What should I do to make visit
http://192.168.1.140/NginxStatus ok?

Posted at Nginx Forum:

And I had run this to config ldf 's password:
#cd /usr/local/nginx/conf
#htpasswd -c htpasswd ldf


But when i visit http://192.168.1.140/NginxStatus, it does not want me
to input the username and password,it just return “403 Forbidden”.

Posted at Nginx Forum:

Hello!

On Thu, Apr 08, 2010 at 05:20:14AM -0400, ultrawind wrote:

[…]

    location /NginxStatus {
         stub_status             on;
         auth_basic              "NginxStatus";
         auth_basic_user_file  conf/htpasswd;

Path in auth_basic_user_file is relative to configuration prefix (by
default it’s directory where nginx.conf resides), so you may want
to remove “conf/” here.

Don’t hesitate to look into your error_log for details.

Maxim D.

Maxim D.,
thank you for you advice,it works now .and next time i will look
error.log first.

Posted at Nginx Forum: