Answer the question
In order to leave comments, you need to log in
How to write a rule for location in NGINX?
Website scripts are in the folder: /var/www
Part of the statics is in the folder: /var/static
I'm trying to write a rule that when accessing /poster/, take statics from /var/static
At the same time, do not pass the name of the poster folder
For example:
we access www .site.ru/poster/hashhashhash/213.jpg the
file is returned from /var/static/hashhashhash/213.jpg I
wrote a rule, but it turned out that it returns from: /var/static/poster/hashhashhash/213.jpg
location ~ ^/poster/.*\.(jpg|gif\png)$ {
root /var/static;
}
Help, confused :-)
Thanks
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