Hey, thanks for answering.
1. Yep, standard. 1 site.
2. Yep, fastcgi_cache. This is the part that I used for the cache:
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-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.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;
}
#include /etc/nginx/conf.sites/bwp-minify.conf;
location ~ .php$ {
location ~* wp\-login\.php {
limit_req zone=one burst=1 nodelay;
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
limit_req_status 403;
}
try_files $uri /index.php;
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
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";
}
3. I use W3 Total Cache just for database and object cache.
4. Yep, the Nginx helper plugin from rtcamp.
5. I’m gonna post the nginx.conf. Also because I couldn’t find where the issue was, I’ve removed all the wordpress plugins and I’ve made the simplest conf file I can do (no fastcgi_cache, no cache at all) and because it still doesn’t work, I’m going to post this one. If you need the more complicated one with the cgi_cache let me know.
nginx.conf
user www-data;
worker_processes 8;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
add_header rt-Fastcgi-Cache $upstream_cache_status;
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##
#include /etc/nginx/naxsi_core.rules;
##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##
#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
site conf
server {
server_name wp.sleeplessmind.info;
access_log /var/log/nginx/wp.sleeplessmind.info.access.log;
error_log /var/log/nginx/wp.sleeplessmind.info.error.log;
root /srv/www/wordpress/public_html;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
# BEGIN BWP Minify WP Rules
# BEGIN BWP Minify Headers
location ~ /wp-content/plugins/bwp-minify/cache/.*\.(js|css)$ {
add_header Cache-Control "public, max-age=7200";
add_header Vary "Accept-Encoding";
etag off;
}
location ~ /wp-content/plugins/bwp-minify/cache/.*\.js\.gz$ {
gzip off;
types {}
default_type application/x-javascript;
add_header Cache-Control "public, max-age=7200";
add_header Content-Encoding gzip;
add_header Vary "Accept-Encoding";
etag off;
}
location ~ /wp-content/plugins/bwp-minify/cache/.*\.css\.gz$ {
gzip off;
types {}
default_type text/css;
add_header Cache-Control "public, max-age=7200";
add_header Content-Encoding gzip;
add_header Vary "Accept-Encoding";
etag off;
}
# END BWP Minify Headers
set $zip_ext "";
if ($http_accept_encoding ~* gzip) {
set $zip_ext ".gz";
}
if (-f $request_filename$zip_ext) {
rewrite (.*) $1$zip_ext break;
}
if (!-e $request_filename) {
rewrite ^/wp-content/plugins/bwp-minify/cache/minify-b(\d+)-([a-zA-Z0-9-_.]+)\.(css|js)$ /index.php?blog=$1&min_group=$2&min_type=$3;
}
# END BWP Minify WP Rules
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php5-fpm-sock;
}
}
Thanks for the help! Greatly appreciated.