Alias which works like in other web servers

Igor Sysoev is at rambler-co.ru
Sun Aug 5 18:18:01 MSD 2007


On Sun, Aug 05, 2007 at 02:19:44PM +0100, marc at corky.net wrote:

> A single alias definition in apache/lighttpd applies to all requests 
> including static files, php, cgi, etc.

I do not know how alias is implemented in lighttpd, but in Apache it is
almost as rewrite that sets r->filename.

It's almost the same as

server {
   ...
   rewrite  /blog(.+)$  /wordpress$1;
   ...

   root  /var/www;

   location   /wordpress {
       ...
   }


> Igor Sysoev wrote:
> >On Sun, Aug 05, 2007 at 11:11:57AM +0100, marc at corky.net wrote:
> >
> >  
> >>Hi,
> >>
> >>Apache:  Alias /blog "/var/www/wordpress"
> >>
> >>lighttpd: alias.url = ( "/blog" => "/var/www/wordpress" )
> >>
> >>Both work pretty much the same way, no special handling of fastcgi or 
> >>other rules are needed.
> >>
> >>The "document root" effectively becomes that of the alias destination 
> >>directory on such requests.
> >>    
> >
> >nginx does the same for static requests:
> >
> >   location /blog  {
> >       alias   /var/www/wordpress;
> >   }
> >
> >What fastcgi configuration will be in Apache and lighty ?
> >
> >  
> >>Igor Sysoev wrote:
> >>    
> >>>On Sun, Aug 05, 2007 at 10:41:50AM +0100, marc at corky.net wrote:
> >>>
> >>> 
> >>>      
> >>>>Would it not be wise to create a type of alias that most people are 
> >>>>comfortable with (and think is logical, due to their previous 
> >>>>experience with other web servers) ?
> >>>>
> >>>>It seems that such an alias would simplify configurations of this type, 
> >>>>which to me look pretty common and useful.
> >>>>   
> >>>>        
> >>>Well, how you will configure this in Apache or lighty ?
> >>>
> >>> 
> >>>      
> >>    
> >
> >  
> 
> 

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





More information about the nginx mailing list