<?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>LinuxSense &#187; 504 Gateway Time-out</title>
	<atom:link href="http://www.linuxsense.org/archives/tag/504-gateway-time-out/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxsense.org</link>
	<description>分享Linux技术的点点滴滴</description>
	<lastBuildDate>Sat, 01 Aug 2009 05:23:11 +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>解决504 Gateway Time-out(nginx)</title>
		<link>http://www.linuxsense.org/archives/260.html</link>
		<comments>http://www.linuxsense.org/archives/260.html#comments</comments>
		<pubDate>Thu, 07 Aug 2008 06:09:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[web构架]]></category>
		<category><![CDATA[504 Gateway Time-out]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://www.linuxsense.org/?p=260</guid>
		<description><![CDATA[504 Gateway Time-out问题常见于使用nginx作为web server的服务器的网站
我遇到这个问题是在升级discuz论坛的时候遇到的
一般看来, 这种情况可能是由于nginx默认的fastcgi进程响应的缓冲区太小造成的, 这将导致fastcgi进程被挂起, 如果你的fastcgi服务对这个挂起处理的不好, 那么最后就极有可能导致504 Gateway Time-out
现在的网站, 尤其某些论坛有大量的回复和很多内容的, 一个页面甚至有几百K
默认的fastcgi进程响应的缓冲区是8K, 我们可以设置大点
在nginx.conf里, 加入:

fastcgi_buffers 8 128k
这表示设置fastcgi缓冲区为8×128k
当然如果您在进行某一项即时的操作, 可能需要nginx的超时参数调大点, 例如设置成60秒:

send_timeout 60;
我只是调整了这两个参数, 结果就是没有再显示那个超时, 可以说效果不错, 但是也可能是由于其他的原因, 目前关于nginx的资料不是很多, 很多事情都需要长期的经验累计才有结果, 期待您的发现哈!


]]></description>
			<content:encoded><![CDATA[<p>504 Gateway Time-out问题常见于使用nginx作为web server的服务器的网站<br />
我遇到这个问题是在升级discuz论坛的时候遇到的<br />
一般看来, 这种情况可能是由于nginx默认的fastcgi进程响应的缓冲区太小造成的, 这将导致fastcgi进程被挂起, 如果你的fastcgi服务对这个挂起处理的不好, 那么最后就极有可能导致504 Gateway Time-out<br />
现在的网站, 尤其某些论坛有大量的回复和很多内容的, 一个页面甚至有几百K<br />
默认的fastcgi进程响应的缓冲区是8K, 我们可以设置大点<br />
在nginx.conf里, 加入:</p>
<blockquote><p>
fastcgi_buffers 8 128k</p></blockquote>
<p>这表示设置fastcgi缓冲区为8×128k<br />
当然如果您在进行某一项即时的操作, 可能需要nginx的超时参数调大点, 例如设置成60秒:</p>
<blockquote><p>
send_timeout 60;</p></blockquote>
<p>我只是调整了这两个参数, 结果就是没有再显示那个超时, 可以说效果不错, 但是也可能是由于其他的原因, 目前关于nginx的资料不是很多, 很多事情都需要长期的经验累计才有结果, 期待您的发现哈!</p>
<hr class="noscreen" />
<!-- /article --><!-- Comments --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxsense.org/archives/260.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
