Answer the question
In order to leave comments, you need to log in
How to look for files in nginx elsewhere?
Please help with Nginx config.
It is necessary that if the file is not found in the target directory - look for it in another directory.
Those. if it was not possible to find
sitename.com/folder/filename.ext
give
stename.com/defaultfolder/sitename.ext
In this case, the folder can be anything.
Answer the question
In order to leave comments, you need to log in
location / {
try_files $uri $uri/ @storage;
}
location @storage {
rewrite ^/.+/(.+)$ /defaultfolder/$1;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question