Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

rewrite specific files in specific folder only

$
0
0
Hello,
I use this rewrite rules (rules not isolated in my vhosts declaration) to rewrite .jpg files with a distant server.

location ~ /(.*).jpg$ {
rewrite ^/pict/(.*).jpg$ /images/$1.jpg last;
proxy_pass http://distante-server.com;
}


This rules works perfectly but impact to the statics .jpf files presents in the server (404 reply).

I would like to isolated this rules in a specific folder (example in "pict" folder), after multi tests I can't do it, if someone have the solution.

like this :


location ~ /pict/(.*).jpg$ {
rewrite ^/pict/(.*).jpg$ /images/$1.jpg last;
proxy_pass http://distante-server.com;
}



Thank you for your help :)

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>