A
A
Anton Manevant2014-03-16 16:58:12
Nginx
Anton Manevant, 2014-03-16 16:58:12

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

1 answer(s)
V
Vlad Zhivotnev, 2014-03-16
@Manevant

Not really.
They do the same thing only for location /.
If you have, for example, location /img, then when the
root /var/wwwlink /img/1,jpg will lead to the file /var/www/img/1.jpg
and when alias /var/wwwthe same link will lead to /var/www/1.jpg.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question