首页  >  问答  >  正文

使用nginx http_stub_status_module时,利用浏览器访问统计页面时,报404

仿照http://renxiangzyq.iteye.com/... 这篇文章添加了http_stub_status_module模块并在nginx.conf中添加了此模块的配置信息,如下所示。

server{
    listen 80;
    server_name xxxxx.com;
    limit_conn perserver 100;
    location /{
        root z.com;
    index index.html; 
    }
location /NginxStatus {
    stub_status on;
    access_log /home/lily/nginx/logs/zcom_status.log;
    auth_basic "NginxStatus"; 
    }
}

xxxxx.com能够正常访问,当访问xxxxx.com/NginxStatus时,报404错误,求原因。

ringa_leeringa_lee2713 天前484

全部回复(2)我来回复

  • 高洛峰

    高洛峰2017-05-16 17:16:30

    ok,找到解决方案了:不用调换location代码块的位置,只是kill掉nginx进程重启一次,再访问xxxxx.com/NginxStatus页面时,就不报404错误了。新手就容易犯这种低级错误哎。

    回复
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 17:16:30

    你把下面的location中的代码放到上面的location试试,然后在重启nginx

    回复
    0
  • 取消回复