Alias which works like in other web servers

Just Marc marc at
Fri Aug 3 14:18:51 MSD 2007


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_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: 

I tried a few things such as putting the fastcgi statements inside every 
location {}  and while that works, it produces bad results as every 
request within that location gets passed to fastcgi, including images, etc.

I found this thread but 
unfortunately it was not answered.

Basically I'm looking to do a 'simple' Alias like in apache or 
lighttpd.    How can I do this?


More information about the nginx mailing list