<?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>深度VPS &#187; Nginx Tags</title>
	<atom:link href="http://www.deepvps.com/tag/nginx-tags/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deepvps.com</link>
	<description>专注VPS技术，关注前端技术</description>
	<lastBuildDate>Sat, 04 Feb 2023 14:00:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>nginx: [warn] the &#8220;log_format&#8221; directive may be used only on &#8220;http&#8221; level 解决方法</title>
		<link>http://www.deepvps.com/nginx-warn-the-log_format-directive-may-be-used-only-on-http-level.html</link>
		<comments>http://www.deepvps.com/nginx-warn-the-log_format-directive-may-be-used-only-on-http-level.html#comments</comments>
		<pubDate>Sat, 18 Feb 2012 16:32:39 +0000</pubDate>
		<dc:creator>deepvps</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[LNMP]]></category>
		<category><![CDATA[log_format]]></category>
		<category><![CDATA[Nginx Tags]]></category>

		<guid isPermaLink="false">http://www.deepvps.com/?p=1044</guid>
		<description><![CDATA[
来自军哥博客的LNMP的最新解决方法，现在转载如下：
一直不提倡使用最新的版本，不过也真因为有部分爱折腾的才会不断的发现问题。目前Nginx的稳定版本是1.0.12，Nginx升级到1.1.1*版本后，会出现nginx: [warn] the &#8220;log_format&#8221; directive may be used only on &#8220;http&#8221; level in /usr/local/nginx/conf/nginx.conf:84的警告。
将/usr/local/nginx/conf/nginx.conf 里server段里的下面代码移出放到该server段的前面即可。
log_format  access  &#8216;$remote_addr &#8211; $remote_user [$time_local] &#8220;$request&#8221; &#8216;
&#8216;$status $body_bytes_sent &#8220;$http_referer&#8221; &#8216;
&#8216;&#8221;$http_user_agent&#8221; $http_x_forwarded_for&#8217;;
如果有其的虚拟主机开启了日志，也按上面的要求移出server段放在server段的前面即可。
再/usr/local/nginx/sbin/nginx -t 测试一下，没有warn警告信息了。
总之，生产环境升级需谨慎。
]]></description>
			<content:encoded><![CDATA[<p><img title="lnmp" src="http://www.deepvps.com/wp-content/uploads/post/lnmp-logo.gif" alt="" width="156" height="46" /></p>
<p>来自军哥博客的LNMP的最新解决方法，现在转载如下：</p>
<p>一直不提倡使用最新的版本，不过也真因为有部分爱折腾的才会不断的发现问题。目前Nginx的稳定版本是1.0.12，Nginx升级到1.1.1*版本后，会出现nginx: [warn] the &#8220;log_format&#8221; directive may be used only on &#8220;http&#8221; level in /usr/local/nginx/conf/nginx.conf:84的警告。<span id="more-1044"></span></p>
<p>将/usr/local/nginx/conf/nginx.conf 里server段里的下面代码移出放到该server段的前面即可。</p>
<p>log_format  access  &#8216;$remote_addr &#8211; $remote_user [$time_local] &#8220;$request&#8221; &#8216;<br />
&#8216;$status $body_bytes_sent &#8220;$http_referer&#8221; &#8216;<br />
&#8216;&#8221;$http_user_agent&#8221; $http_x_forwarded_for&#8217;;</p>
<p>如果有其的虚拟主机开启了日志，也按上面的要求移出server段放在server段的前面即可。</p>
<p>再/usr/local/nginx/sbin/nginx -t 测试一下，没有warn警告信息了。</p>
<p>总之，生产环境升级需谨慎。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.deepvps.com/nginx-warn-the-log_format-directive-may-be-used-only-on-http-level.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
