Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to setup nginx with stub status so I can monitor nginx requests etc.. with serverdensity.com. I needed to put something like this in nginx.conf

server {
       listen 82.113.147.xxx;
       location /nginx_status {
           stub_status on;
           access_log   off;
           allow 82.113.147.xxx;
           deny all;
       }

   }

And with this monitoring acctualy works. However It seems I lost "include" part in my nginx.conf and now none of vhosts in sites-enabled work. Here is a bit more of my nginx.conf

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    server_tokens off;

    access_log  /var/log/nginx/access.log;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;


    gzip  on;
    gzip_comp_level 2;
    gzip_proxied any;
    gzip_types  text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

    server {
       listen 82.113.147.226;
       location /nginx_status {
           stub_status on;
           access_log   off;
           allow 82.113.147.226;
           deny all;
       }

   }



}

Hope someone can help me with this , as I belive its minor issue, its just that "I dont see it"

ty

share|improve this question
add comment

3 Answers 3

Could it be that your listen directive intercepts requests to other servers? I would change it to use a different port number, like listen 8888.

share|improve this answer
add comment

Do you have server_name direcive in site-enabed configs?

PS. You can also listen on another IP/PORt for server status.

share|improve this answer
add comment

I think some of the sites-enabled vhosts are conflicting with the configuration on nginx.conf . Check if the server_name directive exists in the vhosts. Also depending on the nginx version you need a dummy server_name to catch client requests that does not match any assigned server_name

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.