0

So I am creating application using microservice architecture. I have few microservices and I want to configure all in kong with custom routes/url.

For example: I have user service and location service and I want those routes in kong looks like this:

GET http://localhost:8001/service/user/list --> http://user-service-url.com/user_list

GET http://localhost:8001/service/location/122332--> http://location-service-url.com/get/122332

I have searched all over the internet and couldn't find anything. Is this possible to achieve in kong ?

Thanks

asked May 8, 2020 at 20:48
2
  • What does .local signify here ? Commented May 9, 2020 at 6:54
  • @Shaleen its suppose to be domain, that contain my service. check here: discuss.konghq.com/t/… i asked the same question with little more details Commented May 9, 2020 at 9:07

2 Answers 2

1

Sure, that is what Kong is supposed to do: reverse-proxying.

Just create a Kong service object containing the complete URL (http://user-service-url.com/user_list) to your upstream service and attach a Kong route object to it with the path you want to publish on your gateway host (/service/user/list).

answered May 23, 2020 at 9:29
Sign up to request clarification or add additional context in comments.

Comments

0

I found a solution, Actually this feature is available in kong but their documentation is very poorly explained.

So basically service is the main url, that's the actual path you want data from, and they have route which get data from actual url:

End User--->routes (can be multiple) --->Service--->Original Url

ex: localhost:8080/service1 ---> /service1 ---> www.google.com

so when you go to localhost:8080/service1 you can see the google page.

answered Oct 2, 2020 at 6:16

1 Comment

Could you please show the configuration you used for this?

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.