欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

為Nginx自定義404,502錯誤頁面的方法

 更新時間:2010年12月20日 10:51:26   作者:  
為Nginx自定義404,502錯誤頁面的方法,需要的朋友可以參考下。
首先打開nginx.conf文件,在fastcgi_temp_file_write_size 128k; 下面添加

fastcgi_intercept_errors on;注意,包括;號

然后在需要定義的站點(diǎn)的里面添加

error_page 404 = /404.htm;
例如:
復(fù)制代碼 代碼如下:

server
{
listen 80;
server_name www.deepvps.com;
index index.html index.htm index.php;
error_page 404 = /404.htm;
include location.conf;
root /home/www/logs;
}

記得404頁面放在站點(diǎn)的跟目錄下…

測試配置
/usr/local/nginx/sbin/nginx -t

沒錯誤就重啟nginx
/etc/init.d/nginx restart

BTW,其他頁面也是這樣定義

error_page 502 = /502.htm;

相關(guān)文章

最新評論