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