Maybe try to put the /medias/ location on top?<br><br><div class="gmail_quote">On Thu, Jun 3, 2010 at 11:50 AM, Axel <span dir="ltr">&lt;<a href="mailto:junk@devignon.fr">junk@devignon.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi guys,<br>
<br>
stupid but tricky question. In my &quot;server&quot; configuration, I added two &quot;location&quot; directives:<br>
<br>
location ~* \.css|\.js|\.jpg|\.jpeg|\.png|\.gif|\.swf|\.svg|\.tiff$ {<br>
        expires 30d;<br>
}<br>
<br>
location /medias/ {<br>
        rewrite ^/medias/(.*) <a href="http://static.mydomain.com/$1" target="_blank">http://static.mydomain.com/$1</a> permanent;<br>
}<br>
<br>
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 &quot;break;&quot; after the rewrite command or to replace &quot;permanent&quot; with &quot;last&quot; or &quot;break&quot;. Nothing does the trick.<br>

<br>
If you have any idea, that would be great.<br>
<br>
Tks<br>
<br>
Axel<br>
<br>
<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://nginx.org/mailman/listinfo/nginx" target="_blank">http://nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br>