V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
1156909789
V2EX  ›  问与答

为什么 nginx 的精准匹配不上

  •  
  •   1156909789 · 2018-11-18 21:18:41 +08:00 · 1487 次点击
    这是一个创建于 1978 天前的主题,其中的信息可能已经有所发展或是发生改变。
    location = / {
        	root   "/www/wwwroot/website";
            index  index.html;
        }
        
        
        
    	location / {
    		index  index.html index.htm index.php;  
      		if (!-e $request_filename) {
       			rewrite  ^(.*)$  /index.php?s=/$1  last;
       			break;
        	}
     	}
    

    规则大概是这样。然后输入 http://domain/ 竟然匹配到了 location / (我有在 location / 中 return 507 发现的) 为什么会这样?谢谢

    1 条回复    2018-11-18 21:29:47 +08:00
    1156909789
        1
    1156909789  
    OP
       2018-11-18 21:29:47 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5138 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 09:30 · PVG 17:30 · LAX 02:30 · JFK 05:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.