2012-11-19 38 views
1

我想要什麼:如何配置ngnix位置?

/=> /var/www/ 
/measurements /var/meassurements 

我開始使用 「位置」:

/=> /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;               
}  

回答

2

下面應該工作:

location/{                
    # root /usr/share/nginx/html;           
    root /var/www/;           
    index index.html index.htm;           
}                   

location /measurements/ {               
    root /var;             
    autoindex on;               
}  

的原因是,路徑由從作爲根+ $ URI,所以你都結束了尋找/var/measurements/measurements