Alias which works like in other web servers

Igor Sysoev is at rambler-co.ru
Fri Aug 3 16:00:23 MSD 2007


On Fri, Aug 03, 2007 at 11:18:51AM +0100, Just Marc wrote:

> I have a website and a wordpress blog under /blog/   The blog scripts 
> are sitting in a different directory, this is the conf:
> 
> server {
>   listen x.x.x.x;
>   root   /var/www/site/;
> 
>   location /blog {
>       alias   /var/www/wordpress;
> 
>       rewrite ^.+?(/.*\.php)$ $1 last;
>       rewrite ^ /index.php last;
>   }
> 
>   location / {
>       rewrite '^/([^\.]*)\.html$'  /index.php?p=$1 last;
>   }
> 
>   location ~ .php$ {
>       fastcgi_pass   10.0.0.1:1026;
>       fastcgi_index  index.php;
>       include        conf/fastcgi.conf;
>   }
> 
> With this conf, a request to: /blog/wp-login.php is processed by the php 
> location resulting in a bad URL (nginx tries to open: 
> /var/www/site/blog/wp-login.php).

Could you describe all mappings that you need ?


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





More information about the nginx mailing list