<?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>502 &#8211; 科技改变生活-雨落星辰</title>
	<atom:link href="https://p1e.cn/html/tag/502/feed" rel="self" type="application/rss+xml" />
	<link>https://p1e.cn</link>
	<description>所有的伟大,都源于一个勇敢的开始</description>
	<lastBuildDate>Tue, 04 May 2021 05:18:45 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>nginx 反向代理 502 错误的解决</title>
		<link>https://p1e.cn/html/2939.html</link>
					<comments>https://p1e.cn/html/2939.html#respond</comments>
		
		<dc:creator><![CDATA[Naoki]]></dc:creator>
		<pubDate>Tue, 04 May 2021 05:18:45 +0000</pubDate>
				<category><![CDATA[运维笔记]]></category>
		<category><![CDATA[502]]></category>
		<category><![CDATA[nginx]]></category>
		<guid isPermaLink="false">https://www.815494.com/?p=2939</guid>

					<description><![CDATA[Nginx反向代理&#8212;-502报错 问题描述：通过nginx反向代理地址之后报错502，后台日志报错信息为（upstream sent too big header while reading response header from upstream） 问题原因：nginx中proxy_buffer_size默认值是4k，第三方地址响应头超过了此长度，Nginx报upstream sent too big header错误，然后client收到的是502。 解决方案：在http字段中增加以下三个参数 p]]></description>
										<content:encoded><![CDATA[<p>Nginx反向代理&#8212;-502报错<br />
问题描述：通过nginx反向代理地址之后报错502，后台日志报错信息为（upstream sent too big header while reading response header from upstream）<br />
问题原因：nginx中proxy_buffer_size默认值是4k，第三方地址响应头超过了此长度，Nginx报upstream sent too big header错误，然后client收到的是502。<br />
解决方案：在http字段中增加以下三个参数<br />
proxy_buffer_size 128k;<br />
作用：Nginx使用该大小申请read_buf（读取数组长度），即大小指定了 upstream header 最大长度，如果响应头超过了这个长度，Nginx会报upstream sent too big header错误，然后client收到的是502。<br />
proxy_buffers   32 32k;<br />
作用：设置存储被代理服务器响应的body所占用的buffer个数和每个buffer大小。<br />
#   proxy_busy_buffers_size 64k;<br />
作用：proxy_busy_buffers_size不是独立的空间，他是proxy_buffers和proxy_buffer_size的一部分。<br />
nginx会在没有完全读完后端响应就开始向客户端传送数据，所以它会划出一部分busy状态的buffer来专门向客户端传送数据(建议为proxy_buffers中单个缓冲区的2倍)，然后它继续从后端取数据。<br />
proxy_busy_buffer_size参数用来设置处于busy状态的buffer有多大。</p>
<div></div>]]></content:encoded>
					
					<wfw:commentRss>https://p1e.cn/html/2939.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
