<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>路途志 &#187; nginx 404错误</title>
	<atom:link href="http://www.lutuzhi.com/tag/nginx-404%e9%94%99%e8%af%af/feed" rel="self" type="application/rss+xml" />
	<link>http://www.lutuzhi.com</link>
	<description>一路走来，路途志</description>
	<lastBuildDate>Mon, 08 Aug 2011 16:04:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>NGINX 配置404错误页面转向</title>
		<link>http://www.lutuzhi.com/theweb/426.html</link>
		<comments>http://www.lutuzhi.com/theweb/426.html#comments</comments>
		<pubDate>Sun, 17 Jan 2010 09:49:00 +0000</pubDate>
		<dc:creator>路途志</dc:creator>
				<category><![CDATA[网站建设]]></category>
		<category><![CDATA[聚焦开源]]></category>
		<category><![CDATA[502错误页面]]></category>
		<category><![CDATA[nginx 404错误]]></category>
		<category><![CDATA[nginx 自定义404]]></category>

		<guid isPermaLink="false">http://www.lutuzhi.com/theweb/426.html</guid>
		<description><![CDATA[&#160; 什么是404页面 如果碰巧网站出了问题，或者用户试图访问一个并不存在的页面时，此时服务器会返回代码为404的错误信息，此时对应页面就是404页面。404页面的默认内容和具体的服务器有关。如果后台用的是NGINX服务器，那么404页面的内容则为： 404 Not Found nginx/0.8.6 &#160; 为什么要自定义404页面 在访问时遇到上面这样的404错误页面，我想99%（未经调查，估计数据）的用户会把页面关掉，用户就这样悄悄的流失了。如果此时能有一个漂亮的页面能够引导用户去他想去的地方必然可以留住用户。因此，每一个网站都应该自定义自己的404页面。 NGINX下如何自定义404页面 IIS和APACHE下自定义404页面的经验介绍文章已经非常多了，NGINX的目前还比较少，凑巧我的几台服务器都是NGINX的，为了解决自家的问题特地对此作了深入的研究。研究结果表明，NGINX下配置自定义的404页面是可行的，而且很简单，只需如下几步： 1.创建自己的404.html页面 2.更改nginx.conf在http定义区域加入： fastcgi_intercept_errors on; 3.更改nginx.conf在server 区域加入： error_page 404 = /404.html 4.测试nginx.conf正确性： /opt/nginx/sbin/nginx –t 如果正确应该显示如下信息： the configuration file /opt/nginx/conf/nginx.conf syntax is ok configuration file /opt/nginx/conf/nginx.conf test is successful 5.重启nginx kill -HUP&#160; `cat /opt/nginx/nginx.pid ` &#160; 配置文件实例： …… http { include&#160;&#160;&#160;&#160;&#160;&#160; mime.types; default_type&#160; application/octet-stream; charset&#160; [...]]]></description>
		<wfw:commentRss>http://www.lutuzhi.com/theweb/426.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

