我结合 tomcat 和 nginx 也做了一些测试,具体如下,
例如访问地址是 http://nginx/test/a.html
配置 1: location /test { ... proxy_pass http://host:9020; } 结果: test/a.html 配置 2: location /test { ... proxy_pass http://host:9020/; } 结果: ROOT/a.html 配置 3: location /test/ { ... proxy_pass http://host:9020; } 结果: test/a.html 配置 4: location /test/ { ... proxy_pass http://host:9020/; } 结果: ROOT/a.html 配置 5: location /test/ { ... proxy_pass http://host:9020/testapp; } 结果: ROOT/testappa.html 配置 6: location /test/ { ... proxy_pass http://host:9020/testapp/; } 结果: testapp/a.html 配置 7: location /test { ... proxy_pass http://host:9020/testapp; } 结果: testapp/a.html 配置 8: location /test { ... proxy_pass http://host:9020/testapp/; } 结果: testapp/a.html 疑问就是配置 7 和 8 结果是一样的?
为什么配置 7 的结果不依照类似配置 1 的结果?
不是 testapp/test/a.html 而是 testapp/a.html ?
