复制
收藏
提问
全网

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 了,怎么修改

yangbaby
2个月前
全网
文档
学术
百科
知识库
时间不限
自动

理解问题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;
    }
}
更专业一些
转笔记
专业
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 了,怎么修改
如何优化Nginx的配置文件?
Nginx如何处理静态资源?
使用Nginx实现负载均衡的方法有哪些?
在线客服