0

I'm using zuul for routing traffic on my project and when I check Swagger file on one of my services I can see that context path is duplicated. Here is my zuul config:

zuul:
  routes:
    myservice:
      path: /myservice/**
      url: http://<host>:<port>/

Then it doesn't work for zuul but myservice is running fine..

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
Alex
  • 1,940
  • 2
  • 18
  • 36
  • Maybe this helps a bit on the debugging. https://stackoverflow.com/a/45941406/5810894 – pan Oct 31 '17 at 22:53

1 Answers1

0

The question has been asked a while ago and you probably found the problem but maybe someone else lands on this page too so...

Your context path being duplicated might be due to the fact that you are not stripping the path with Zuul. Your route is matched based on the path you specify but if your client services already pass this path when querying the downstream service (the one behind your api gateway) you will end up with:

host/myService/myService?queryParams

To resolve just set stripPrefix to true as such:

zuul:
  stripPrefix: true
  routes:
    myservice:
      path: /myservice/**
      url: http://<host>:<port>/

Hope this helps.

Joud C
  • 427
  • 3
  • 6