How can have unique route?

Hi
I’m new in Kong. I want kong to route request between multiple services (as the usual job of on ) bu the problem is kong accept the same route for multiple services and just first route working in this situation. I can not handle myself because kong UI is used by multiple programmers in my office. for example, assume I have two services with and I assigned them the routes with the same details (same host and same path ). in this situation, kong accept both routes for both services but when I send the request to the route, Kong redirects me to the service that the first route was assigned to it and the second service will be ignored! why kong does not accept service name (some unique identification of service) instead of route’s host in request so routing will be unique (same Nginx)?


as you can see I have two services with the same route details. but when I request to curl -I --url http://0.0.0.0:8000/ --header 'Host:g' kong redirect me to service by the name ‘digi’.
thank you.

Hi,

I think that there are ways to limit the behavior that you are seeing. If you look at the Proxy Reference you can see the defined Matching priorities, basically is that it will match the more explicit and most rules containing route.

The behavior that you are trying to achieve is, if I’m not wrong, that Kong will not be able to publish an API if there is another one with the exact same rules configured. This is only available in Kong Enterprise, and basicaly avoid the publish of the API when it is found on another workspace, if it is in the same workspace the behavior is exactly the same that in the Community version.

Regards

1 Like