nginx 配置404、500、502等錯誤頁
1.創建自己的404.html頁麵2.更改nginx.conf在http定義區域加入: fastcgi_intercept_errors on;
3.更改nginx.conf(或單獨網站配置文件,例如在nginx -> sites-enabled下的站點配置文件 )
中在server 區域加入: error_page 404 /404.html 或者 error_page 404 =https://www.xxx.com/404.html
4.更改後重啟nginx,,測試nginx.conf正確性: /opt/nginx/sbin/nginx –t
#502 等錯誤可以用同樣的方法來配置。
error_page 500 502 503 504 /50x.html;
最後更新:2017-04-03 12:53:57