Fork me on GitHub

nginx---状态栏

一、修改配置

server {
        server_name www.a.net;
        root /data/site1;
        location / {
        }
        location /admin {
                root /data/;
                auth_basic "Admin Page";
                auth_basic_user_file /etc/nginx/conf.d/.nginx_passwd;
        }
        location /nginx_status {
        stub_status;
        allow 127.0.0.1;
        allow 172.16.8.0/24;
        allow 192.168.1.0/24;
        deny all;
        }
}

主要内容stub_status;,其他的只是为了安全,设置了只能通过某些特定的IP地址访问

 

posted @ 2021-06-01 14:42  Alex-Lzy  阅读(50)  评论(0)    收藏  举报