Zuul proxy same request to another port

1.2k Views Asked by At

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. I want to send the same URL, parameters, etc.

The reason I am doing this is that using a ZuulFilter which is doing some checks.

For example I want to get to localhost:8943/humans/get/1 and send the request to localhost:8080/humans/get/1

Thanks in advance.

2

There are 2 best solutions below

0
On BEST ANSWER

I've managed to do it with the following configuration:

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

Something like this should work.

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