Nginx 的斜线访问
http://192.168.1.1/test/api
1 2 3 4
| location /test/ { proxy_pass http://192.168.2.2/; } 收到的请求: //api
|
1 2 3 4
| location /test { proxy_pass http://192.168.2.2/; } 收到的请求: //api
|
1 2 3 4
| location /test/ { proxy_pass http://192.168.2.2; } 收到的请求: /test/api
|
1 2 3 4
| location /test { proxy_pass http://192.168.2.2 } 收到的请求: /test/api
|
1 2 3 4
| location /test/ { proxy_pass http://192.168.2.2/on/; } 收到的请求: /on/api
|
1 2 3 4
| location /test { proxy_pass http://192.168.2.2/on/; } 收到的请求: /on//api
|
1 2 3 4
| location /test/ { proxy_pass http://192.168.2.2/on; } 收到的请求: /onapi
|
1 2 3 4
| location /test { proxy_pass http://192.168.2.2/on; } 收到的请求为: /on/api
|