wordpress rewrite nginx
Per Jonsson
poj+nginx at lysator.liu.se
Tue Feb 13 17:33:47 MSK 2007
Shouldn't that be changed around like this:
server {
listen my.ip.here;
server_name sub.domain.tld;
access_log /var/log/nginx/subdomain.access_log main;
error_log /var/log/nginx/subdomain.error_log;
rewrite ^(.*)?/?files/(.*) /wp-content/blogs.php?file=$2;
location / {
root /var/www/localhost/htdocs/sub.domain.tld;
allow 192.168.2.0/24;
deny all;
if (!-e $request_filename) {
rewrite ^([_0-9a-zA-Z-]+)?(/wp-.*) $2 last;
rewrite ^([_0-9a-zA-Z-]+)?(/.*\.php)$ $2 last;
rewrite ^ /index.php last;
}
}
location ~ .php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:1105;
fastcgi_index index.php;
# where the php files to pass to the listener.
fastcgi_param SCRIPT_FILENAME
/var/www/localhost/htdocs/subdomain.tld$fastcgi_script_name;
}
}
}
At least it feels more sane to check for existance when you have a root fixed.
I can be wrong, as nginx's nonlinear config can be somewhat confusing, but that
is the way we're doing it in our setup.
Best Wishes,
Per Jonsson
Lysator ACS
More information about the nginx
mailing list