Answer the question
In order to leave comments, you need to log in
What location for nginx should be written so that trailing slash is not taken into account?
Issue resolved.
Answer: do not forget about the priorities between location in nginx. It was necessary to place the necessary rewrite above :)
/photo/2015-01-01/big-photo.jpg
location ~/photo/(.*) {
return 301 http://tipacdn.яndex.net/sitename$1;
location ~/photo/(.*)/(.*) {
return 301 http://tipacdn.яndex.net/sitename$uri;
}
location /photo {
rewrite ^/photo(.*) http://tipacdn.яndex.net/sitename$1 permanent;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question