-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WordPress: W3 Total Cache conflict #33
Comments
Most likely it doesn't work because W3TC requires certain additions to nginx config. I've added experimental support of W3TC to the latest version, can be enabled via Could you please confirm that the change helps. See referenced commit for more details. |
First off; thank you for improving the W3 Total Cache experience with the Nginx image @csandanov! Secondly; I only see references to the Enhanced page cache in the experimental configuration. Is it on purpose that this logic is not applied to the "Basic" page cache option as well? (they use two different pathes: Lastly; apparently the solution to the specific issue was pretty easy. While testing your latest configuration, I found an option that's actually the cause of the issue (see attached screenshot). I simply didn't think this was an option based on the messages received in the Nginx log. I think we get the notice below because the condition for
|
Could you please clarify why would you need all 404 .html requests being redirected to index.php? What are these .html files? Just static files or is this a tricky approach W3TC uses for caching dynamic page (weird)? |
* upstream/master: (24 commits) Update nginx to 1.17.2 Update base image stability tag to 2.3.1 Rebuild against updated base image Rebuild against updated base image Rebuild against updated base image Add two different ways to add sitemap.xml locations Add sitemap.xml rules for WP Update nginx to 1.17.1 Update base image stability tag to 2.3.0 Rebuild against updated base image Rebuild against updated base image Add nginx 1.17 Rebuild against updated base image Add experimental W3TC support wodby#33 Update base image stability tag to 2.2.3 Hide pagespeed version, closes wodby#32 Add Nginx 1.16 Rebuild against updated base image Update notifications email Update nginx to 1.15.12 ...
Howdy,
I have found a conflict between Wodby and W3 Total Cache which I believe is due to a rewrite that needs a condition in the nginx WordPress preset.
Nginx will throw a 404 when a user tries to access an HTML file that do not exist when "Browser cache" is enabled in W3 Total Cache.
It is the following configuration, added in W3's Nginx configuration, that will start the problem:
This configuration will cause an error giving a 404 response in Nginx instead of passing the URL to the web app when a user tries to access a static html file that do not exist. See the error message below.
I'm guessing it's this rewrite rule that's the cause of the conflict: https://github.com/wodby/nginx/blob/master/templates/presets/wordpress.conf.tmpl#L109
How to reproduce:
Browser cache
in W3 Total Cache (or import this json settings file )nginx.conf
file in the root of the WordPress site (NGINX_SERVER_EXTRA_CONF_FILEPATH: /var/www/html/dev.nginx.conf
).html
(example:http://vanilla-install.localhost/unknown-path.html
)What was expected?
I expected the URL to be passed to WordPress so WordPress would be able to determine if it was an actual error or not. Right now Nginx just throws a 404 without hitting the web app.
Edit: Updated line-number in WordPress preset template.
The text was updated successfully, but these errors were encountered: