[nginx] The difference between root and alias in nginx:

Article directory


The main difference between root and alias is that nginx如何解释location后面的urithis will cause the two to map requests to server files in different ways.
The processing result of root is: root路径+location路径
The processing result of alias is: 使用alias路径替换location路径
alias是一个目录别名的定义,root则是最上层目录的定义. Another important difference is alias后面必须要用"/"结束that otherwise the file will not be found. . . And root is
optionalalias标签的目录块中不能使用rewrite的break

insert image description here
insert image description here
insert image description here
insert image description here

Guess you like

Origin blog.csdn.net/weixin_53791978/article/details/131927429