nginx error_page的配置


error_page可以配置在http、server、location塊;

 

1. 跳轉

error_page 404 http://www.baidu.com;

 

2. 重定向

我嘗試把頁面放到別的路徑下,但是error日志顯示,error.html只能放在nginx/html目錄下,查看官方文檔也沒有其他方法。

error_page 404 =200 /error.html;

 

3.@符號指定到location的url上

error_page 404 @another_url;
        location @another_url {
            root /home/wc/nginx.d;
        }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM