# Why my NginxStatus do not work?

**URL:** <https://www.ruby-forum.com/t/why-my-nginxstatus-do-not-work/186529>\
**Category:** NGINX\
**Created:** [April 8, 2010, 11:20am UTC](https://www.ruby-forum.com/t/why-my-nginxstatus-do-not-work/186529 "2010-04-08T11:20:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ultrawind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/73ab20/32.png) [@ultrawind](https://www.ruby-forum.com/u/ultrawind)\
**Post date:** [April 8, 2010, 11:20am UTC](https://www.ruby-forum.com/t/why-my-nginxstatus-do-not-work/186529/1 "2010-04-08T11:20:59Z")

</div>

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](http://192.168.1.140), and it is OK.  
But I visit [http://192.168.1.140/NginxStatus](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](http://192.168.1.140/NginxStatus) ok?

Posted at Nginx Forum:

> **[why my NginxStatus do not work?](https://forum.nginx.org/read.php?2,72641,72641#msg-72641)**
>
> 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\_conn

---

<div class="post-metadata">

**Author:** ![ultrawind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/73ab20/32.png) [@ultrawind](https://www.ruby-forum.com/u/ultrawind)\
**Post date:** [April 8, 2010, 11:24am UTC](https://www.ruby-forum.com/t/why-my-nginxstatus-do-not-work/186529/2 "2010-04-08T11:24:30Z")

</div>

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](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:

> **[Re: why my NginxStatus do not work?](https://forum.nginx.org/read.php?2,72641,72644#msg-72644)**
>
> 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\_conn

---

<div class="post-metadata">

**Author:** ![ultrawind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/73ab20/32.png) [@ultrawind](https://www.ruby-forum.com/u/ultrawind)\
**Post date:** [April 8, 2010, 12:20pm UTC](https://www.ruby-forum.com/t/why-my-nginxstatus-do-not-work/186529/3 "2010-04-08T12:20:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ultrawind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/73ab20/32.png) [@ultrawind](https://www.ruby-forum.com/u/ultrawind)\
**Post date:** [April 9, 2010, 3:25am UTC](https://www.ruby-forum.com/t/why-my-nginxstatus-do-not-work/186529/4 "2010-04-09T03:25:52Z")

</div>

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

Posted at Nginx Forum:

> **[Re: why my NginxStatus do not work?](https://forum.nginx.org/read.php?2,72641,72970#msg-72970)**
>
> 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\_conn
