nginx配置之禁止访问和404错误功能配置

禁止访问功能配置

    nginx.conf中的http{}中的server{}的location ..{}中:

     location / { 

        #拒绝访问,192.168.16.0网段的同学都无法访问 /24是子网掩码的意思 

        deny 192.168.16.0/24; 

        root     html; 

        index     index.html index.htm; 

      }

404页面

    nginx.conf中的http{}中的server{}中:

       #error_page 404 /404.html;

posted @ 2019-07-27 17:12  笑得好美  阅读(2238)  评论(0编辑  收藏  举报