wordpress rewrite nginx

Igor Sysoev is at rambler-co.ru
Tue Feb 13 18:29:49 MSK 2007


On Tue, Feb 13, 2007 at 03:47:09PM +0200, Anonymous Coward wrote:
> Thank you Igor,
> 
> I tried your suggestion too but i have the same behavoir with the exception
> that now i see few more images but the design is still screwed.
> I added just the rules from "#uploaded files" down because im testing the
> blog in a subdomain now so the www thing is not needed and i would've used
> the virtual hosts to handle it anyway.
> I doubt that it's a problem with the files or anything because im using the
> same directory for Apache and it works ok with the rules i mentioned... and
> in nginx the first page looks ok, only posts and other blogs that should use
> the rewrite are screwed.
> 
> Just to be sure im posting my nginx config (from server directive down):
> 
>        server {
>                listen          my.ip.here;
>                server_name     sub.domain.tld;

+                root    /var/www/localhost/htdocs/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;
> 
>               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 / {
>                root    /var/www/localhost/htdocs/sub.domain.tld;
>                allow 192.168.2.0/24;
>                deny all;
>                }
>        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;
>                }
>        }
> }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list