如何在没有URL端口号的情况下将流量转移到目标服务器 [英] How to divert the traffic to targer servers without port number in URL

查看:124
本文介绍了如何在没有URL端口号的情况下将流量转移到目标服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有4个Web服务器,这些Web服务器托管了将近8个不同的网站。
我打算使用基于路径的路由,例如





更新:



如果所有应用程序都在同一实例上运行,则需要



在上面的屏幕截图中,假设每个目标组后面都有一个实例,但有五个不同的目标组,因此 api.example.com 将路由到其自己的目标组。


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.

解决方案

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.

这篇关于如何在没有URL端口号的情况下将流量转移到目标服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆