<?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空主机头</title>
	<atom:link href="http://www.osyunwei.com/archives/tag/%E7%A6%81%E6%AD%A2nginx%E7%A9%BA%E4%B8%BB%E6%9C%BA%E5%A4%B4/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>Linux系统下禁止nginx空主机头</title>
		<link>https://www.osyunwei.com/archives/803.html</link>
		<comments>https://www.osyunwei.com/archives/803.html#comments</comments>
		<pubDate>Thu, 03 Nov 2011 14:50:32 +0000</pubDate>
		<dc:creator>qihang01</dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[禁止nginx空主机头]]></category>

		<guid isPermaLink="false">http://w66416.s75.chinaccnet.cn/?p=803</guid>
		<description><![CDATA[引言：为了防止域名解析恶意指向，我们需要禁止nginx默认的空主机头，操作如下 vi /usr/local/nginx/conf/nginx.conf    #配置文件 系统运维  www.osyunwei.com  温馨提醒：qihang01原创内容©版权所有,转载请注明出处及原文链接 找到server，在上面一行添加如下内容： ############################## server {      listen       80 default;      server_name  _;      location / {      root   html;      return 404;                     }      location ~ /.ht {      deny  all;                       }        } ############################## /etc/rc.d/init.d/nginx restart     #重启nginx 这样设置之后，空主机头访问会直接跳转到nginx404错误页面。 &#160;&#160;&#160;&#160;&#160;» 本文链接：https://www.osyunwei.com/archives/803.html» 订阅本站：https://www.osyunwei.com/feed» 转载请注明来源：系统运维 » Linux系统下禁止nginx空主机头<p><a rel="bookmark" href="https://www.osyunwei.com/archives/803.html" target="_blank">查看全文</a></p>]]></description>
		<wfw:commentRss>https://www.osyunwei.com/archives/803.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
