atom feed4 messages in ru.sysoev.nginxRe: Rewrite question
FromSent OnAttachments
AxelJun 3, 2010 8:49 am 
Ilan BerknerJun 3, 2010 8:59 am 
Maxim DouninJun 3, 2010 9:10 am 
AxelJun 3, 2010 9:16 am 
Subject:Re: Rewrite question
From:Maxim Dounin (mdou@mdounin.ru)
Date:Jun 3, 2010 9:10:09 am
List:ru.sysoev.nginx

Hello!

On Thu, Jun 03, 2010 at 05:50:08PM +0200, Axel wrote:

stupid but tricky question. In my "server" configuration, I added two "location" directives:

location ~* \.css|\.js|\.jpg|\.jpeg|\.png|\.gif|\.swf|\.svg|\.tiff$ { expires 30d; }

location /medias/ {

- location /medias/ { + location ^~ /medias/ {

rewrite ^/medias/(.*) http://static.mydomain.com/$1 permanent; }

The rewrite works fine except for jpg files. I suppose there is a conflict between the two locations. It works if I comment out the first location. I tried to invert locations or to add a "break;" after the rewrite command or to replace "permanent" with "last" or "break". Nothing does the trick.

See here for details:

http://wiki.nginx.org/NginxHttpCoreModule#location