0

I have a couple of microservices and a frontend running over different ports exposed via Kong.

The issue is even for routes like "/add", "/edit", "/swagger" etc., the route for frontend which is "/" gets called.

Service: abc-microservice Path: /abc/swagger Strip_Path: false Preserve Host: true

Service: frontend Route: / Strip_Path: false Preserve Host: true

Expectation: PUT POST for www.xyz.com/abc/swagger leads to www.xyz.com/abc/swagger

Actual: PUT POST for www.xyz.com/abc/swagger leads to www.xyz.com/ which is the frontend.

How do I tackle this particular issue?

  • What is the issue? – Alexis Aug 29 '21 at 02:26
  • @Alexis: I have frontend for which the route is defined as "/" and other microservices which have routes as "/edit", "/add" etc., Calling "/edit" or "/add" lands me to the frontend page itself – genius_monkey Aug 29 '21 at 05:34
  • Please provide more information. What does your Kong configuration look like? Which URLs should be routed to a micro service, which ones to the front-end? What is the front-end? A SPA based on React, Angular, Vue.js? Have you monitored the effective HTTP requests? Or are you assuming that the URL shown in the browser matches 1 to 1 with HTTP requests? – Codo Aug 29 '21 at 07:59
  • @Codo: Updated my question adding more information. – genius_monkey Aug 30 '21 at 05:01
  • Your expectations do not make sense. A request to `www.xyz.com/abc/swagger` cannot be route to itself. It should probably be routed to `www.xyz.com:8080/abc/swagger` or `swagger.xyz.com/abc/swagger`. Even more likely, you are just looking at the brower's address bar instead of at the effective HTTP request. Use the browser's inspector to look at the real requests and provide a complete Kong configuration that includes the service configuration. – Codo Aug 30 '21 at 07:27
  • @Codo: I think i failed to explain it properly but my issue has got resolved with one of the routes being enabled the STRIP_PATH which seemed to have caused the issue. Kong is actually suppose to route www.xyz.com/abc/swagger to /abc/swagger endpoint which it is doing now. Not sure how did you end up with " It should probably be routed to www.xyz.com:8080/abc/swagger or swagger.xyz.com/abc/swagger". Nonetheless, the issue has been resolved. Thanks :) – genius_monkey Aug 30 '21 at 08:24

0 Answers0