1156909789
V2EX  ›  问与答

为什么 nginx 的精准匹配不上

  •  
  •   1156909789 · Nov 18, 2018 · 2013 views
    This topic created in 2780 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   ·   1670 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 16:19 · PVG 00:19 · LAX 09:19 · JFK 12:19
    ♥ Do have faith in what you're doing.