How to divert the traffic to targer servers without port number in URL

纵然是瞬间 提交于 2019-12-02 23:08:20

问题


I have 4 web servers, These web servers hosts nearly 8 different websites. I am planning to use path based routing like http://myexample.com/website1/..

For example when i deployed by application on port 8580 and create the path based rule in ALB.. and hit the url it is not working. Instead i had to use http://myexample.com:8580/website1.

Please help to resolve this, how can i remove the port number from URL.

Since all these are internal application under single domain. I do not have an option of using different domain names or different load balances.


回答1:


The reason is your load balancer listening on the same port which is used in the webserver.

You need to define a listener for LB to listen on a port and forward traffic to target on the desired group.

specify port 8580 in the target group and specify 80 in the Loadbalancer listener.

Update:

If all application running on the same instance you need host-based routing.

In the above screenshot, suppose behind each target group there is one instance, but five different target group so api.example.com will route to its own target group.



来源:https://stackoverflow.com/questions/57899034/how-to-divert-the-traffic-to-targer-servers-without-port-number-in-url

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