Answer the question
In order to leave comments, you need to log in
How to correctly compose a regular expression for nginx rewrite?
Good afternoon!
I ask for help from the regexp gurus in solving the problem. There is a link like
http://www.site.com/upload/catalog/posob/_/s/_s-1024_cover_image_small.jpeg
http://www.site.com/upload/catalog/posob/_/s/_s-1024_/cover_image_small.jpeg
Answer the question
In order to leave comments, you need to log in
location ~ /upload/catalog/posob/_/s/_s-(?<code>\d+)_cover_image_small.jpeg$ {
rewrite ^ /upload/catalog/posob/_/s/_s-$code/cover_image_small.jpeg last;
}
</code>
PS /code не нужен это что то тостер глючит с тегами
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question