Cloud Foundry map-route is not working when path mentioned

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 08:24:04

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/40803666/cloud-foundry-map-route-is-not-working-when-path-mentioned

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!