nginx 配置錯誤頁面


server {

...

include 404.conf;

...

}

vi 404.conf

proxy_intercept_errors on;
error_page 404 @404;
error_page 503 @503;
error_page 502 @502;
error_page 403 @403;
error_page 500 @500;
location @404 {
root html;

rewrite (.*) /error.html break;
}
location ^~ /wdzj_404.png {
root html;
}
location @503 {
root html;
rewrite (.*) /503.html break;
}
location ^~ /wdzj_503.png {
root html;
}
location @403 {
root html;
rewrite (.*) /403.html break;
}
location ^~ /wdzj_403.png {
root html;
}

location @502 {
root html;
rewrite (.*) /502.html break;
}
location ^~ /wdzj_502.png {
root html;
}
location @500 {
root html;
rewrite (.*) /502.html break;
}

 

#以上404.conf  40*.html,50*.html,wdzj_*.png 這些文件都在前端的nginx目錄下的html目錄下


免責聲明!

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



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