url rewrite help

rkmr.em at gmail.com rkmr.em at gmail.com
Sat Dec 8 21:01:36 MSK 2007


On Dec 8, 2007 9:45 AM, Igor Sysoev <is at rambler-co.ru> wrote:

> On Sat, Dec 08, 2007 at 09:31:49AM -0800, rkmr.em at gmail.com wrote:
> > i am moving from lighttpd to nginx, and I had this rewrite in lighttd.
> how
> > do i do this in nginx?
> >    "^/[^/]+\.xml$" => "/static$0",
> > i tried and dint work
> >   rewrite    ^/[^/]+\.xml$  /static$1;
> You do not need rewrite. Try to avoid a rewrite as much as possible.
>     location ~ ^/[^/]+\.xml$ {
>         root   /path/to/static;
>     }


this has to be in server section right? if i want this common for all
virtual hosts, how do i do it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20071208/c6390761/attachment.html>


More information about the nginx mailing list