server { listen 80; server_name www.slavi.biz; rewrite ^/(.*) http://slavi.biz/$1 permanent; } server { listen 80; server_name slavi.biz; charset utf-8; access_log /var/www/vhosts/slavi.biz/logs/access.log; error_log /var/www/vhosts/slavi.biz/logs/error.log; root /var/www/vhosts/slavi.biz/htdocs; index index.php index.html; error_page 404 500 502 503 504 /; location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME /var/www/vhosts/slavi.biz/htdocs$fastcgi_script_name; } location /blog/ { # src: nginex rules for supercache: http://forum.slicehost.com/comments.php?DiscussionID=2087 index index.php; # enable search for precompressed files ending in .gz # nginx needs to be complied using –-with-http_gzip_static_module # for this to work, comment out if using nginx from aptitude gzip_static on; # if the requested file exists, return it immediately if (-f $request_filename) { break; } set $supercache_file ''; set $supercache_uri $request_uri; if ($request_method = POST) { set $supercache_uri ''; } # Using pretty permalinks, so bypass the cache for any query string if ($query_string) { set $supercache_uri ''; } if ($http_cookie ~* "comment_author_|wordpress|wp-postpass_" ) { set $supercache_uri ''; } # if we haven't bypassed the cache, specify our supercache file if ($supercache_uri ~ ^(.+)$) { set $supercache_file /blog/wp-content/cache/supercache/$http_host/$1index.html; } # only rewrite to the supercache file if it actually exists if (-f $document_root$supercache_file) { rewrite ^(.*)$ $supercache_file break; } if (!-e $request_filename) { rewrite ^/blog/(.+)$ /blog/index.php?q=$1 last; } } }