nginx允许IP访问不生效问题【原创】

使用nginx的nginx_upstream_check模块来检测后端服务器的转态时,设置只允许某段IP访问,发现不生效,不在此网段的IP也可以访问。

原因为在允许IP访问最后一定要加deny all;表示除了上面allow的其他都禁止

配置如下:

    location /status {
        check_status;
        access_log   off;
        allow 10.2.72.26;
        deny all;
    }

最后要加deny all

 

posted @ 2019-03-28 15:07  paul_hch  阅读(4101)  评论(0编辑  收藏  举报