在kong api网关中,如何创建自定义网址?

问题描述 投票:0回答:1

因此,我正在使用微服务架构创建应用程序。我的微服务很少,我想用自定义的路由/ URL在香港进行全部配置。

例如:我有用户服务和位置服务,我希望那些在香港的路线看起来像这样:

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

我已经在整个互联网上进行搜索,找不到任何东西。这在香港有可能实现吗?

谢谢

microservices api-gateway kong
1个回答
0
投票

当然,Kong应该这样做:反向代理。

只需创建一个包含完整URL(http://user-service-url.com/user_list)的Kong服务对象到上游服务,然后将Kong路由对象附加到您要在网关主机(/service/user/list)上发布的路径。

© www.soinside.com 2019 - 2024. All rights reserved.