简体   繁体   English

Zuul将同一请求代理到另一个端口

[英]Zuul proxy same request to another port

I want to be able to proxy with Zuul running on a Spring Boot server listening to port X to port Y where an nginx is listening on the same machine. 我希望能够与在Spring Boot服务器上运行的Zuul进行代理,以监听端口X到Nginx在同一台机器上监听的端口Y。 I want to send the same URL, parameters, etc. 我想发送相同的URL,参数等。

The reason I am doing this is that using a ZuulFilter which is doing some checks. 我这样做的原因是使用ZuulFilter进行了一些检查。

For example I want to get to localhost:8943/humans/get/1 and send the request to localhost:8080/humans/get/1 例如,我想到达localhost:8943/humans/get/1并将请求发送到localhost:8080/humans/get/1

Thanks in advance. 提前致谢。

Something like this should work. 这样的事情应该起作用。

zuul:
  routes:
    humans:
      path: /humans/**
      url: http://localhost:8080

I've managed to do it with the following configuration: 我已经通过以下配置成功做到了:

zuul:
  routes:
    services:
      path: /**  
      url: http://localhost:8043/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM