Hello everyone,
It’s my first post here. I’d like to thanks everyone involved with Easyengine. Really good work
After migrate my site to easyengine I ran a site update with the --wp --wpfc swtich. I noticed that it installs and configure W3TC plugin, right? I’ve disabled it. Do I need it?
I saw that it tried also to install Nginx Helper Plugin, but when I checked on my wp backend it wans’t installed. I installed it manually. I was following this tutorial: https://easyengine.io/wordpress-nginx/tutorials/single-site/fastcgi-cache-with-purging/
In this tutorial W3TC is not mentioned, I suppose I don’t need it to use fastcgi_cache…
nginx-cache-purge is OK on my end.
Using ramdisk (tmpfs) for cached content. I don’t have any tmpfs listed on my filesystem, Im running ubuntu 14.04 on a vpsdime server. There’s something I can do about this?
Next step is to edit /etc/nginx/sites-available/example.com file:
When I paste this code inside my file:
set $skip_cache 0;
POST requests and urls with a query string should always go to PHP
if ($request_method = POST) { set $skip_cache 1; }
if ($query_string != “”) { set $skip_cache 1; }
Don’t cache uris containing the following segments
if ($request_uri ~* “/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php|sitemap(_index)?.xml”) { set $skip_cache 1; }
Don’t use the cache for logged in users or recent commenters
if ($http_cookie ~* “comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in”) { set $skip_cache 1; }
location / { try_files $uri $uri/ /index.php?$args; }
location ~ .php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass 127.0.0.1:9000;
fastcgi_cache_bypass $skip_cache; fastcgi_no_cache $skip_cache;
fastcgi_cache WORDPRESS; fastcgi_cache_valid 60m;
}
location ~ /purge(/.*) { fastcgi_cache_purge WORDPRESS “$scheme$request_method$host$1”; }
location ~* ^.+.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; }
location = /robots.txt { access_log off; log_not_found off; } location ~ /. { deny all; access_log off; log_not_found off; }
And when I run nginx -t && service nginx reload I get:
nginx: [emerg] duplicate location “/” in /etc/nginx/common/wpfc.conf:20 nginx: configuration file /etc/nginx/nginx.conf test failed
If I undo the changes everything works.
For these lines mentioned in the tutorial:
fastcgi_cache_path /var/run/nginx-cache levels=1:2 keys_zone=WORDPRESS:100m inactive=60m; fastcgi_cache_key “$scheme$request_method$host$request_uri”; fastcgi_cache_use_stale error timeout invalid_header http_500; fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
Do I have to do all these modifications even if i ran --wp --wpfc switches? I’m confused.
Thanks in advance for any help.
Regards
Bruno B.