Welcome! Log In Create A New Profile

Advanced

rewrite specific files in specific folder only

Posted by Noname 
rewrite specific files in specific folder only
October 12, 2014 09:07AM
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 :)
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 216
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready