Trouble with nginx
-
No matter what I try, only appears to be creating /wp-content/cache/page_enhanced files for hits on the rss feed! Other than a few feed hits, /wp-content/cache/page_enhanced is empty.
I have been going crazy trying to figure this out. I don’t think it’s the nginx config, since the page cache files are not being created. I would try sticking them in the APC cache rather than Disk Enhanced, but I don’t know what syntax I’d use in the nginx / location line.
File permissions must be fine, as the _index.html files are being created on the feed hits.
The site is http://www.whatsthatbug.com.
Here is my / location line in the nginx conf file:
try_files /wp-content/cache/page_enhanced/${host}${cache_uri}_index.html $uri $uri/ /index.php?$args ;And this is the file I am including:
# BEGIN W3TC Page Cache core rewrite ^(.*\/)?w3tc_rewrite_test$ $1?w3tc_rewrite_test=1 last; set $w3tc_rewrite 1; if ($request_method = POST) { set $w3tc_rewrite 0; } if ($query_string != "") { set $w3tc_rewrite 0; } if ($request_uri !~ \/$) { 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\.2\.11)") { set $w3tc_rewrite 0; } 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.html$w3tc_enc") { set $w3tc_ext .html; } if (-f "$document_root/wp-content/cache/page_enhanced/$http_host/$request_uri/_index.xml$w3tc_enc") { set $w3tc_ext .xml; } if ($w3tc_ext = "") { set $w3tc_rewrite 0; } if ($w3tc_rewrite = 1) { rewrite .* "/wp-content/cache/page_enhanced/$http_host/$request_uri/_index$w3tc_ext$w3tc_enc" last; } # END W3TC Page Cache core # BEGIN W3TC Page Cache cache location ~ /wp-content/cache/page_enhanced.*html$ { expires modified 3600s; add_header Vary "Accept-Encoding, Cookie"; add_header Pragma "public"; add_header Cache-Control "max-age=3600, public"; } location ~ /wp-content/cache/page_enhanced.*gzip$ { gzip off; types {} default_type text/html; expires modified 3600s; add_header Vary "Accept-Encoding, Cookie"; add_header Pragma "public"; add_header Cache-Control "max-age=3600, public"; add_header Content-Encoding gzip; } # END W3TC Page Cache cache # BEGIN W3TC Browser Cache gzip on; gzip_types text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; location ~ \.(css|htc|js|js2|js3|js4)$ { expires 31536000s; add_header Pragma "public"; add_header Cache-Control "max-age=31536000, public"; } location ~ \.(html|htm|rtf|rtx|svg|svgz|txt|xsd|xsl|xml)$ { expires 3600s; add_header Pragma "public"; add_header Cache-Control "max-age=3600, public"; } location ~ \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|json|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|otf|odb|odc|odf|odg|odp|ods|odt|ogg|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|tif|tiff|ttf|ttc|wav|wma|wri|xla|xls|xlsx|xlt|xlw|zip)$ { expires 31536000s; add_header Pragma "public"; add_header Cache-Control "max-age=31536000, public"; } # END W3TC Browser Cache # BEGIN W3TC Minify core rewrite ^/wp-content/cache/minify.*/w3tc_rewrite_test$ /wp-content/plugins/w3-total-cache/pub/minify.php?w3tc_rewrite_test=1 last; rewrite ^/wp-content/cache/minify/(.+/[X]+\.css)$ /wp-content/plugins/w3-total-cache/pub/minify.php?test_file=$1 last; rewrite ^/wp-content/cache/minify/(.+\.(css|js))$ /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1 last; # END W3TC Minify core
The topic ‘Trouble with nginx’ is closed to new replies.