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;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM