每个小时左右,我开始在wp-admin和wp-admin / admin-ajax.php上得到500个错误。 我运行DSO + APC + Nginx(admin)+ Apache。 Apache在8080端口和Nginx上运行。
我到目前为止所做的:
0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client
因为我的日志显示tmp inode全部用完并崩溃nginx 我正在为Nginx前端使用以下vhostsconfiguration:
# BEGIN W3TC Page Cache cache location ~ /wp-content/cache/page_enhanced.*html$ { add_header Vary "Accept-Encoding, Cookie"; add_header Pragma "no-cache"; add_header Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"; } location ~ /wp-content/cache/page_enhanced.*gzip$ { gzip off; types {} default_type text/html; add_header Vary "Accept-Encoding, Cookie"; add_header Pragma "no-cache"; add_header Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"; add_header Content-Encoding gzip; } # END W3TC Page Cache cache # BEGIN W3TC Page Cache core #set $w3tc_rewrite 1; set $w3tc_rewrite ""; if ($request_method = POST) { set $w3tc_rewrite 0; } if ($query_string != "") { set $w3tc_rewrite 0; } if ($http_cookie ~* "(comment_author|wp\-postpass|w3tc_logged_out|wordpress_logged_in|wptouch_switch_toggle)") { set $w3tc_rewrite 0; } if ($http_user_agent ~* "(W3\ Total\ Cache/0\.9\.4)") { set $w3tc_rewrite 0; } if ($http_cookie ~* "(w3tc_preview)") { set $w3tc_rewrite _preview; } set $w3tc_enc ""; if ($http_accept_encoding ~ gzip) { set $w3tc_enc _gzip; } set $w3tc_ext ""; if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_rewrite.html$w3tc_enc") { set $w3tc_ext .html; } if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_rewrite.xml$w3tc_enc") { set $w3tc_ext .xml; } if ($w3tc_ext = "") { set $w3tc_rewrite 0; } #if ($w3tc_rewrite = 1) { if ($w3tc_rewrite != 0) { rewrite .* "/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_rewrite$w3tc_ext$w3tc_enc" last; } # END W3TC Page Cache core
我在这里排除wp-admin – 可能的罪魁祸首?
# Don't cache uris containing the following segments if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-location$ set $cache_uri 'null cache'; } location / { error_page 405 = @backend; add_header X-Cache "HIT from Backend"; proxy_pass http://backend:8080; include proxy.inc; include microcache.inc; }
临时解决方法是重新启动nginx。 我正在使用一个简单的nginx.conf。
虽然我没有把它缩小,但是我想在这里做一个有根据的猜测。
最有可能的事情,帮助我解决这个问题:
我应该再次遇到这个问题,或者我find根本原因,我会再次更新