server { listen 80; server_name www.nneye.cn; client_max_body_size 50m; location / { root html/vision.test/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /vpm { #root html/ibv.com.test/; root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } } 访问 www.nneye.cn/vpm 等同于访问 www.nneye.cn 了,怎么修改
理解问题server { listen 80; server_name www.nneye.cn; client_max_body_size 50m; location / { root html/vision.test/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /vpm { #root html/ibv.com.test/; root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } } 访问 www.nneye.cn/vpm 等同于访问 www.nneye.cn 了,怎么修改
已完成理解「server { listen 80; server_name www.nneye.cn; client_max_body_size 50m; location / { root html/vision.test/; index index.html index.htm; try_files $uri $uri/ /index.html; } location /vpm { #root html/ibv.com.test/; root html/iFLIP.com/; index index.html index.htm; try_files $uri $uri/ /index.html; } } 访问 www.nneye.cn/vpm 等同于访问 www.nneye.cn 了,怎么修改」
展开阅读网页
访问 www.nneye.cn/vpm 等同于访问 www.nneye.cn,需调整 location 配置避免重叠。
location 配置调整
- 避免重叠:调整
/vpm
的配置,使其独立。 - 精确路径映射:确保
/vpm
下的请求正确映射至指定目录。
server {
listen 80;
server_name www.nneye.cn;
client_max_body_size 50m;
location / {
root html/vision.test/;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
location /vpm {
root html/iFLIP.com/;
index index.html index.htm;
try_files $uri $uri/ /vpm/index.html;
}
}