Comprehensive Rewrite Rules / Regular Expressions Guide?

Igor Sysoev is at rambler-co.ru
Wed Apr 1 15:32:48 MSD 2009


On Wed, Apr 01, 2009 at 03:50:53AM -0700, Michael Shadle wrote:

> 2009/4/1 Igor Sysoev <is at rambler-co.ru>:
> 
> > No.
> >
> >    server  {
> >         server_name  www.example.de;
> >         ...
> >    }
> >
> >    server  {
> >         server_name  _; # any names
> >
> >         rewrite   ^   http://www.example.de$request_uri? permanent;
> >    }
> 
> What about this?
> 
> server {
>         listen 80;
>         server_name michaelshadle.com;
>         index index.php index.html;
> ... etc ...
> }
> 
> server {
>         listen 80;
>         server_name www.michaelshadle.com;
>         rewrite ^(.*) http://michaelshadle.com$1 permanent;
> }
> 
> Any better?
> 
> Any worse?

         rewrite ^ http://michaelshadle.com$request_uri? permanent;

slightly faster than

         rewrite ^(.*) http://michaelshadle.com$1 permanent;


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





More information about the nginx mailing list