服务织物URL路由 [英] service fabric URL routing

查看:109
本文介绍了服务织物URL路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Azure的负载平衡器的Azure与面料的服务来托管多​​个自托管Web应用程序,我想创建一个规则,让我根据用户的URL请求的路线。

I am using the Azure Load Balancer with Azure service fabric to host multiple self host web applications, I'd like to create a rule that allows me to route based on the users URL request.

因此​​,例如,如果用户导航到:

So for example if a user navigates to :

的http:// domain.com/Site1 则该规则将路线:
的http:// domain.com **:** 8181 /站点1 集群内的

http:// domain.com/Site1 then the rule would route to: http:// domain.com**:8181**/Site1 within the cluster

如果用户导航到

的http:// domain.com/Site2 则该规则将路线:
的http:// domain.com **:** 8282 /站点2 集群内的

http:// domain.com/Site2 then the rule would route to: http:// domain.com**:8282**/Site2 within the cluster

这可能与蔚蓝的服务布料/负载均衡?

Is this possible with azure service fabric/load balancer?

推荐答案

Azure的负载均衡只是单向地接收到一个端口上的一个节点集群中的另一个端口上(可以是相同的端口或不同的内部端口) 。它运行在4(TCP,UDP)层,以便它不知道有关HTTP或网址(虽然它确实允许HTTP探针)。

The Azure Load Balancer only forwards traffic it receives on a port to a node in your cluster on another port (can be the same port or a different internal port). It operates on Layer 4 (TCP, UDP) so it doesn't know anything about HTTP or URLs (although it does allow HTTP probes).

下面是多个网站的一对夫妇的选择:

Here are a couple options for multiple web sites:

如果你想在内部托管的不同端口(8181和8282),那么你就需要点别的事情做URL路由你的网站。 Azure的流量管理器或Azure应用程序网关是将集群外运行可能的选择。您Azure的负载均衡需要打开每个网站的端口,但它的好处是这种方式,您可以在专用节点上运行你的web站点和ALB会自动将流量路由到基于哪个端口上适当的节点是开放的。

If you want your web sites hosted internally on different ports (8181 and 8282), then you'll need something else to do URL routing. Azure Traffic Manager or Azure Application Gateway are possible options that would run outside your cluster. Your Azure Load Balancer would need to open a port for each web site, but the benefit is this way you can run your web sites on dedicated nodes and the ALB would automatically route traffic to the appropriate nodes based on which ports are open.

另外,你可以设置你的集群中运行自己的无状态的路由服务。

Alternatively, you can set up your own stateless routing service that runs inside your cluster.

或者你也可以完全跳过路由,只是承载所有网站的端口80/443。只要您使用HTTP.SYS基于网络的主机,包括武士刀,ASP.NET核心1 WebListener,或任何你基础上的HttpListener,您可以使用您的所有网站相同的端口,让潜在的HTTP服务器根据任一URL路径或主机名,这两者都支持的路由。

Or you can skip routing altogether and just host all of your websites on port 80/443. As long as you're using an http.sys-based web host, which includes Katana, ASP.NET Core 1 WebListener, or anything you build on HttpListener, you can use the same port for all your websites and let the underlying http server route according to either a URL path or hostname, both of which are supported.

这篇关于服务织物URL路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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