spring-cloud / spring-cloud-netflix

Integration with Netflix OSS components
http://cloud.spring.io/spring-cloud-netflix/
Apache License 2.0
4.87k stars 2.44k forks source link

Zuul route doesn't map propertly with ribbon listOfServers #2935

Closed prokopatti closed 6 years ago

prokopatti commented 6 years ago

(Using spring-cloud-starter-netflix-zuul 1.4.4) I am trying to configure ribbon for my zuul routes, so when I go to http://host1:port1/restful-service/app1 it should route me to http://host2:port2/rest-example/app1. It works properly when I define the route with "url" property, without using ribbon:

zuul:
  routes:
      restful-service:
          path: /restful-service/**
          url: http://host2:port2/rest-example

But when I try to use ribbon, which looks like this:

zuul:
  routes:
    restful-service:
      path: /restful-service/**
      serviceId: restful-service

ribbon:
  eureka:
    enabled: false

restful-service:
  ribbon:
    listOfServers: host2:port2/rest-example

It only allows me to route to http://host2:port2/rest-example but not to the chosen service directly http://host2:port2/rest-example/app1 (it returns 404 status code).

ryanjbaxter commented 6 years ago

the listOfServers property only supports host and port not path.