Nginx1.4+设置默认404页面
之前参考了不少文件,配置均不生效。
过程(ubuntu):
1.到nginx安装目录新建一个404.html /usr/share/nginx/html
2.到各server节点下新增404处理逻辑
vim /etc/nginx/sites-enabled/default
server { listen 80 ; server_name m.xx.com; root /var/www/m; index m.html; error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html; } }
误解一, 要vim /etc/nginx/nginx.conf ,在http块加fastcgi_intercept_errors参数
http { #fastcgi_intercept_errors on;
This module allows Nginx to interact with FastCGI processes and control what parameters are passed to the process.
这个模块仅对fastcgi生效,yes就是说纯html的跳转,其实不加这个参数即可。
相关推荐
csstpeixun 2020-06-28
competeking 2020-06-14
Dreamya 2020-06-09
XuDanT 2020-06-07
byourb 2020-05-14
zhangxiaocc 2020-01-30
lanzhusiyu 2019-12-30
孙雪峰 2019-08-23
高触Toucher 2018-04-16
AGGirl 2018-10-31
霸王棍 2011-05-12
麦当劳 2011-12-15
贫农 2015-11-04
industry0 2013-12-21
yanghan 2011-09-15
wawaboss 2012-04-10
tydanei 2019-07-01