<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Plugin on 豆博草堂</title><link>https://idocbox.com/tags/plugin/</link><description>Recent content in Plugin on 豆博草堂</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 18 Dec 2016 00:00:00 +0000</lastBuildDate><atom:link href="https://idocbox.com/tags/plugin/index.xml" rel="self" type="application/rss+xml"/><item><title>wordpress登录后站点出现 502错误</title><link>https://idocbox.com/posts/wordpress-502-while-logined/</link><pubDate>Sun, 18 Dec 2016 00:00:00 +0000</pubDate><guid>https://idocbox.com/posts/wordpress-502-while-logined/</guid><description>&lt;p&gt;最近发现，wordpress 4.7 在登录后，如果再次访问自己站点会直接出现502错误，但是如果非登录状态，则访问都是正常的。这个现象非常奇怪。无论如何，先登录服务器看日志：&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;tail -f /var/log/nginx/error.log
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;然后在登录状态下访问我的网站，发现有如下日志，&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;2016/12/21 14:59:57 [error] 8551#0: *26 upstream sent too big header while reading response header from upstream, client: **.*.*.*, server: idocbox.com, request: &amp;#34;GET / HTTP/1.1&amp;#34;, upstream: &amp;#34;fastcgi://unix:/var/run/php5-fpm.sock:&amp;#34;, host: &amp;#34;idocbox.com&amp;#34;, referrer: &amp;#34;http://idocbox.com/wp-admin/plugins.php?plugin_status=all&amp;amp;paged=1&amp;amp;s&amp;#34;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;看来是头信息过大导致超时了，所以出现了502错误。一番简单搜索，得到如下解决方案：&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;sudo vi /etc/nginx/sites-enabled/idocbox.com
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;在里面增加&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; fastcgi_buffer_size 128k;
fastcgi_buffers 32 32k;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;修改后配置片段，&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;location ~ \.php$ {
fastcgi_buffer_size 128k;
fastcgi_buffers 32 32k;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have &amp;#34;cgi.fix_pathinfo = 0;&amp;#34; in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;然后重启nginx，&lt;/p&gt;</description></item></channel></rss>