1156909789
V2EX  ›  问与答

为什么 nginx 的精准匹配不上

  •  
  •   1156909789 · Nov 18, 2018 · 1960 views
    This topic created in 2748 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   ·   929 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 20:54 · PVG 04:54 · LAX 13:54 · JFK 16:54
    ♥ Do have faith in what you're doing.