Answer the question
In order to leave comments, you need to log in
How to correctly set location to a specific folder in Nginx?
I need to write in the nginx.conf file to:
server {
...
location ~* ^.+\.(rss|atom|jpg|jpeg|gif|png|ico|rtf|js|css)$ {
expires max;
}
...
}
Answer the question
In order to leave comments, you need to log in
In the server block, add a location block like this:
location / { root /data/www; }
This location block specifies "/" as a prefix, which is compared to the URI from the request. For suitable requests, by adding the URI to the path specified in the root directive, that is, in this case, to /data/www, the path to the requested file on the local file system is obtained.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question