W3 Total with rtcamp nginx repository question


#1

Hi,

I had work done by rtcamp to install nginx and fastcgi (no ee) and I have just recently installed w3 total, and want to know if i have to change anything in my sites-available.config:

server {
listen 80;

server_name website.com www.website.com;

root /var/www/html;
error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root /usr/share/nginx/html;

}

index index.php index.html index.htm;

# subs_filter www.website.com/wp-content d3uv72d4ga7dsx.cloudfront.net/wp-content; 
#subs_filter www.website.com/wp-includes d3uv72d4ga7dsx.cloudfront.net/wp-includes/;
#subs_filter www.website.com/wp-content/uploads d3uv72d4ga7dsx.cloudfront.net/wp-content/uploads;
#subs_filter www.website.com/wp-content/themes d3uv72d4ga7dsx.cloudfront.net/wp-content/themes;
#subs_filter www.website.com/wp-content/cache d3uv72d4ga7dsx.cloudfront.net/wp-content/cache;


# WPFC NGINX CONFIGURATION

set $skip_cache 0;

# POST requests and URL with a query string should always go to php
if ($request_method = POST) {
    set $skip_cache 1;
}

if ($query_string != "") {
    set $skip_cache 0;
}

# Don't cache URL containing the following segments
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|wp-.*.php|index.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
    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 $cache_uri 'null cache';
}   

# Cache admin-ajax.php
if ($request_uri ~* "/wp-admin/admin-ajax.php") {
    set $skip_cache 0;
}
# Don't use the cache for logged in users or recent commenter
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
    set $skip_cache 1;
}

# Use cached or actual file if they exists, Otherwise pass request to WordPress
location / {

    try_files $uri $uri/ /index.php?$args;
}

location ~ ^/wp-content/cache/minify/(.+\.(css|js))$ {
    try_files $uri /wp-content/plugins/w3-total-cache/pub/minify.php?file=$1;
}

location ~ \.php$ {
#	try_files $uri /index.php?$args =404;
        try_files $uri /index.php =404;
        include fastcgi_params;
    fastcgi_pass hhvm;

    fastcgi_cache_bypass $skip_cache;
    fastcgi_no_cache $skip_cache;

    fastcgi_cache WORDPRESS;
}

location ~ /purge(/.*) {
    fastcgi_cache_purge WORDPRESS "$scheme$request_method$host$1";
}
location = /favicon.ico {
    access_log off;
    log_not_found off;
    # expires 1m;
}
location = /robots.txt {
    allow all;
    access_log off;
    log_not_found off;
}

# Cache Static Files For As Long As Possible
location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|css|rss|atom|js|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;
}
# Security Settings For Better Privacy Deny Hidden Files
location ~ /\. {
    deny all;
    access_log off;
    log_not_found off;
}
# Return 403 Forbidden For readme.(txt|html) or license.(txt|html)
if ($request_uri ~* "^.+(readme|license)\.(txt|html)$") {
	return 403;
}
# Disallow PHP In Upload Folder
location /wp-content/uploads/ {
    location ~ \.php$ {
            deny all;
    }
}

}

Is there anything i need to change here to get w3 total integrated better? I’ve commented out the CDN’s as w3 will now do that. Thanks,


#2