首頁  >  問答  >  主體

使用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 天前487

全部回覆(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
  • 取消回覆