Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Has anybody setup WordPress Nginx proxy cache integrator plugin


stormin303
Participant

@stormin303

I did not so long ago but wasn’t happy with the memory footprint I was having on my VPS mainly due to Apache being too resource hungry and the intermintent lock ups of my server because Apache likes memory for breakfast, especially when it gets busy and even when its not busy at times. Plus I had to tone down the static caching because I was doing a lot of development work on it and got fed up waiting for the new content to appear.

Gone back to pure Nginx and certainly not looking back at the moment.

Running Nginx, PHP-FastCGI, WP3 MS, BP and a whole heap of WP plugins and my site certainly has an edge over any other setup I’ve installed on it in the past, especially Memory/Speed wise.

Biggest problem I have found with Nginx Rewrites is getting Images, avatars, avartar uploadds working. Nginx rewrites for WPMU 2.9.2 and WP3 MS are different (not sure about WP 2.9.2). Couldn’t find a working solution online so came up with my own based on the what I’ve learnt over the last few months. Probably better solutions as I’m not an expert but the important thing is that they work :).

If you want to try yourself heres the Nginx rewrites I’m currenly using…

location / {
root /www//root;
index index.php;

gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;

if (!-e $request_filename) {
rewrite ^.+/?(/ms-.*) $1 last;
rewrite ^/files/(.+) /wp-includes/ms-files.php?file=$1 last;
rewrite ^.+/?(/wp-.*) $1 last;
rewrite ^.+/?(/.*.php)$ $1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
expires 10d;
break;

}
}

location ~* ^.+.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
{
root /www//root;
rewrite ^/.*(/wp-.*/.*.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
rewrite ^.*/files/(.*(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+/?(/wp-.*) $1 last;
rewrite ^.+/?(/.*.php)$ $1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
}

expires 30d;
break;
}

location ~ .php$ {
root /www//root;
keepalive_timeout 0;

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /www//root/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}

Skip to toolbar