1
just1 2015-12-25 18:15:57 +08:00 via Android 1
location ^~ /test/ {
proxy_pass http://backend/; } |
3
shajiquan 2015-12-26 02:31:29 +08:00 1
你要先在你这边重写 url ,再请求过去。
upstream test_upstream{ # server wiki.shajiquan.com; server 127.0.0.1:9801; } server { listen 9101; location /test/ { rewrite /test/(.+)$ /$1 break; proxy_pass http://test_upstream ; proxy_redirect off; } } |
4
lekai63 2015-12-26 11:56:01 +08:00 1
楼主参考这篇吧。
https://segmentfault.com/a/1190000000406581 server { listen 80; server_name backednd; root /path/to/www/root; #也可省略 location / { rewrite /(.*) /test/$1 break; proxy_pass https://a.com/; } } |