Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: nginx re-write rules

I’m using this one (found it on mu.wordpress.org/forums). I’m having problems creating new blogs, but I’m not sure if it’s nginx causing the problem (it works fine with wpmu):

server
{

listen 80;
server_name DOMAIN.COM *.DOMAIN.COM;

access_log /usr/local/nginx/logs/DOMAIN.COM.access.log;
error_log /usr/local/nginx/logs/DOMAIN.COM.error.log;

# rewrite rule for files

location ~* ^.+.(xml|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|swf)$
{
root /home/web/DOMAIN.COM/www;
rewrite ^/files(/.*)$ /wp-content/blogs.php?file=$1 last;
expires 10d;
break;
}

# rewrite rule for sitemap under the lines that handles upload files

rewrite ^(.*/)?sitemap.xml wp-content/sitemap.php;

# rewrite errors

location /
{
#auth_basic "Restricted";
#auth_basic_user_file /etc/nginx/htpasswd;
root /home/web/DOMAIN.COM/www;
index index.php;
error_page 404 = /index.php?q=$uri;
}

#send php requests to fast cgi

location ~ .php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/web/DOMAIN.COM/www$fastcgi_script_name;
include /usr/local/nginx/conf/fastcgi_params;
}

}

Skip to toolbar