我想要的是什么:
/ => /var/www/
/measurements /var/meassurements
我使用的是" location":
/ => /var/www/
/measurements => /var/measurements/measurements
我做错了什么?
配置-片段:
location / {
# root /usr/share/nginx/html;
root /var/www/;
index index.html index.htm;
}
location /measurements {
root /var/measurements/;
autoindex on;
}
答案 0 :(得分:2)
以下内容应该有效:
location / {
# root /usr/share/nginx/html;
root /var/www/;
index index.html index.htm;
}
location /measurements/ {
root /var;
autoindex on;
}
原因是路径是以root + $ uri组成的,所以你最终都在寻找/var/measurements/measurements