<?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; 404错误</title>
	<atom:link href="http://www.osyunwei.com/archives/tag/404%E9%94%99%E8%AF%AF/feed" rel="self" type="application/rss+xml" />
	<link>https://www.osyunwei.com</link>
	<description>国产化OS/AnolisOS/openEuler/RHEL/CentOS/Rocky Linux/Debian/Ubuntu Linux FreeBSD 服务器教程 &#124; Windows Server 2003/2008/2012/2016/2019/2022/2025服务器教程</description>
	<lastBuildDate>Tue, 14 Apr 2026 10:59:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Nginx自定义404错误页面</title>
		<link>https://www.osyunwei.com/archives/4999.html</link>
		<comments>https://www.osyunwei.com/archives/4999.html#comments</comments>
		<pubDate>Sun, 29 Jul 2012 09:16:13 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[LNMP]]></category>
		<category><![CDATA[404错误]]></category>
		<category><![CDATA[Nginx 404]]></category>

		<guid isPermaLink="false">http://www.osyunwei.com/?p=4999</guid>
		<description><![CDATA[说明 站点1：bbs.osyunwei.com 站点2：sns.osyunwei.com 404自定义页面地址：http://www.osyunwei.com/404.html 如下图所示： 实现目的： 用户访问站点1和站点2的时候，如果出现404错误，会跳转到http://www.osyunwei.com/404.html页面 一、编辑nginx主配置文件 vi /usr/local/nginx/conf/nginx.conf  #编辑，找到http { 在下面添加以下2行代码，如下图所示 fastcgi_intercept_errors on;    #打开nginx自定义错误选项 系统运维 www.osyunwei.com 温馨提醒：qihang01原创内容版权所有,转载请注明出处及原文链接 error_page  404 http://www.osyunwei.com/404.html;  #指定nginx 404 错误页面 :wq!  #保存退出 二、重启nginx service nginx restart #重启，或者平滑重启 service nginx reload  #nginx服务不中断，重新加载配置 三、测试 打开bbs.osyunwei.com如下图所示 打开http://bbs.osyunwei.com/osyunwei.html （服务器上没有这个页面），出现下面的界面： 系统运维 www.osyunwei.com 温馨提醒：qihang01原创内容版权所有,转载请注明出处及原文链接 配置成功 同样打开http://sns.osyunwei.com/osyunwei.html(服务器上没有这个页面)，也会出现上面的界面 扩展阅读 如果要实现： 站点1：bbs.osyunwei.com 站点2：sns.osyunwei.com 分别指向不同的404错误页面 1、在nginx主配置文件中http { 下面只添加一行 系统运维 www.osyunwei.com [...]<p><a rel="bookmark" href="https://www.osyunwei.com/archives/4999.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/4999.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
