Answer the question
In order to leave comments, you need to log in
What is the difference between the directives root and alias in nginx "on the fingers"?
Good afternoon. I don’t understand a little, what is the difference between alias and root in nginx? Do they actually do the same thing? When is it better to use root and when alias?
Answer the question
In order to leave comments, you need to log in
Not really.
They do the same thing only for location /.
If you have, for example, location /img, then when the root /var/www
link /img/1,jpg will lead to the file /var/www/img/1.jpg
and when alias /var/www
the same link will lead to /var/www/1.jpg.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question