zttom
Forum Replies Created
-
Forum: Plugins
In reply to: [W3 Total Cache] BUG FIX: nginx rules – page_enhanced cacheI sent the author a message with the fix included. If you change the lines in PgCacheAdminEnvironment.php it should work. For me it is definitively an programming failure at the time the nginx.conf is generated. I tested my fix with version W3 Total Cache 0.9.4.1. Changing the nginx.conf directly (as described at the top of this post or in other posts will only fix it until you change the settings of the plugin, since the file is completely generated for every new setting). Don’t forget to include the generated nginx.conf in you nginx config.
Forum: Plugins
In reply to: [W3 Total Cache] BUG FIX: nginx rules – page_enhanced cacheThe error is deeper. Please fix following lines in wp-content/plugins/w3-total-cache/lib/W3/PgCacheAdminEnvironment.php from beginning from line 960 (tested with version 0.9.4.1):
/** * Check for preview cookie */ $rules .= "if (\$http_cookie ~* \"(w3tc_preview)\") {\n"; $rules .= " set \$w3tc_rewrite _preview;\n"; $rules .= "}\n"; $env_w3tc_preview = "\$w3tc_rewrite";It should be:
/** * Check for preview cookie */ $rules .= "if (\$http_cookie ~* \"(w3tc_preview)\") {\n"; $rules .= " set \$w3tc_preview _preview;\n"; $rules .= "}\n"; $env_w3tc_preview = "\$w3tc_preview";They did a mistake by using w3tc_rewrite and not w3tc_preview. w3tc_rewrite is used in the generated nginx.conf in a different context, so it should be w3tc_preview. After the correction the generated nginx.conf works perfectly!
Forum: Plugins
In reply to: [W3 Total Cache] Error in W3TC nginx config?The error is deeper. Please fix following lines in wp-content/plugins/w3-total-cache/lib/W3/PgCacheAdminEnvironment.php from beginning from line 960 (tested with version 0.9.4.1):
/** * Check for preview cookie */ $rules .= "if (\$http_cookie ~* \"(w3tc_preview)\") {\n"; $rules .= " set \$w3tc_rewrite _preview;\n"; $rules .= "}\n"; $env_w3tc_preview = "\$w3tc_rewrite";It should be:
/** * Check for preview cookie */ $rules .= "if (\$http_cookie ~* \"(w3tc_preview)\") {\n"; $rules .= " set \$w3tc_preview _preview;\n"; $rules .= "}\n"; $env_w3tc_preview = "\$w3tc_preview";They did a mistake by using w3tc_rewrite and not w3tc_preview. w3tc_rewrite is used in the generated nginx.conf in a different context, so it should be w3tc_preview. After the correction the generated nginx.conf works perfectly!