需要在Nginx中使用 proxy_pass 进行帮助。
从外部访问 Nginx 的 URL 将会像这样: http://some-IP:8080/v2/platform/general/activity/plan?.....
我的下游服务看起来像这样: http://another-IP:8080/activity/plan?...
我想要从原始公共 URL 中去掉
/v2/platform/general
并像上面那样调用我的下游服务。
在 Nginx 中,我应该如何将公共访问 URL 重定向到下游服务?
我尝试了这个:
location /v2/platform/general/ {
rewrite ^/(.*) /$1 break;
proxy_redirect off;
proxy_pass http://another-IP:8080;
proxy_set_header Host $host;
但是它没有起作用,任何帮助将不胜感激。