Reputation: 656
In Cloud Foundry I have pushed two copies of the same application, Say app1 and app2. I need to route a specific request from app1 to app2. Note: app1 and app2 are one and the same, but just i have deployed twice in different name. so the /collections endpoint though it exists in app1, I would like to handle this only via app2 application.So I have created the following routes.
cf map-route app2 mydomain.com --hostname app1 --path collections
cf map-route app1 mydomain.com --hostname app1
By the above route, I expect https://app1.mydomain.com/collections request to handled by app2 application. Except the /collections endpoint, all the other requests (https://app1.mydomain.com/*) are expected to be handled by app1.
Post the above mentioned router mapping also, I could see that https://app1.mydomain.com/collections request is being served by app1.
But when i have only the below route, expecting all the request to https://app1.mydomain.com/* is to be served by app2. this case is working fine. cf map-route app2 mydomain.com --hostname app1
So I'm having trouble only routing my https://app1.mydomain.com/collections to a app2 application.
Kindly help me in resolving this.
Upvotes: 0
Views: 1729
Reputation: 13501
The behaviour for overlapping routes is not specified in the documentation, so I think the problem that you're having is that your two rules overlap and there is no way to set a precedence that the most specific rule should win.
The solution would be to have mutually exclusive routes.
Upvotes: 1