I
I
i_want_to_know_everything2016-12-09 07:16:42
Nginx
i_want_to_know_everything, 2016-12-09 07:16:42

Nginx redirect with filename parsing?

I make thins from directories as follows

location ~ ^/wp-content/uploads/2015/01/(.*) {
    return 301 /assets/images/2016/11/$1;
}

However, in the 2015/01/ folder, there may be cropped files with an indication of the size:
  • xxx-150x150.jpg
  • xxx-250х150.jpg
  • xxx-400х350.jpg
  • etc

In the folder 2016/11 they may not be there, but the original is always present xxx.jpg
How to always redirect to the original?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nurlan, 2016-12-09
@daager

nginx.org/ru/docs/http/ngx_http_core_module.html#t...
If I understood you correctly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question