V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
1156909789
V2EX  ›  问与答

为什么 nginx 的精准匹配不上

  •  
  •   1156909789 · Nov 18, 2018 · 1924 views
    This topic created in 2729 days ago, the information mentioned may be changed or developed.
    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 replies    2018-11-18 21:29:47 +08:00
    1156909789
        1
    1156909789  
    OP
       Nov 18, 2018
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3151 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 03:17 · PVG 11:17 · LAX 20:17 · JFK 23:17
    ♥ Do have faith in what you're doing.