作为网站目录托管单独的应用程序服务

发布于 2025-01-28 09:19:15 字数 95 浏览 4 评论 0 原文

是否可以将单独的Azure应用程序服务作为另一个应用程序服务的一部分?

例如,假设我有一个名为

因此,换句话说,当请求提交

提前致谢。

Is it possible to include a separate Azure App Service as part of another App Service?

For example lets say that I have a website called www.mycompany.com hosted in its own Azure App Service. I have another Azure App Service that I want to make it accessible by going to a specific URL in the first App Service.

So in other words when a request comes to www.mycompany.com/eu/ I want the content of this endpoint (/eu) to be served from the other app service. Would a load balancer work? The reason I want to do this is because the /eu endpoint has grown too big and I would like to separate that from the main site and host it on a separate app service. I hope my question is clear.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦断已成空 2025-02-04 09:19:15

为此,您可以使用应用程序网关。

从某种意义上说,它类似于您指出的负载平衡器(确实是L7 lb),但是该产品提供了许多其他功能。

从产品文档中提取的以下图像解释了它的工作原理:

“应用程序网关如何工作”

基本上,如上述文档在描述应用程序网关如何接受请求时(请注意,他们在说明中提到WAF,这是一种可选的安全威胁预防系统):

  1. 客户端将请求发送到应用程序网关之前
    通过使用域解决应用程序网关的域名
    名称系统(DNS)服务器。 Azure控制DNS条目,因为
    应用程序网关在Azure.com域中。

  2. Azure DNS将IP地址返回给客户端,这是
    应用程序网关的前端IP地址。

  3. 应用程序网关接受一个或多个的传入流量
    听众。听众是一个检查的逻辑实体
    连接请求。它配置为前端IP地址,
    协议,以及从客户端连接到的端口号
    应用程序网关。

  4. 如果正在使用Web应用程序防火墙(WAF),则该应用程序
    网关检查请求标题和身体(如果存在)
    违反WAF规则。此操作确定请求是否有效
    请求或安全威胁。如果请求有效,则路由
    到后端。如果请求没有有效,并且WAF在预防中
    模式,它被阻止为安全威胁。如果处于检测模式,
    对请求进行了评估和记录,但仍转发给
    后端服务器。

连接到一个后端或另一个后端的路由可以基于 url路径

“基于URL路径的路由”

您可以在此相关的Microsoft Article

在您的用例中,您需要定义两个后端,一个用于每个应用程序服务,并根据适当的方式定义路由规则。

如前所述,您的DNS应指向应用程序网关:它将根据路由来处理到一个或其他应用程序服务的路由,/eu/*/* ,由客户提供。

路线的顺序很重要:一旦规则匹配,它将是处理的。

应用程序网关是一项区域服务: Azure前门在全球范围内利用类似的功能(以及更多功能)。

请考虑查看这些服务的相关费用。

For this purpose you could use Application Gateway.

In a certain sense it resembles a load balancer (it is a L7 LB indeed) as you indicated, but the product provides many additional features.

The following image, extracted from the product documentation, explains how it works:

how application gateway works

Basically, as outlined in the aforementioned docs, when describing how an Application Gateway accepts a request (note they mention WAF in the explanation, an optional security threat prevention system):

  1. Before a client sends a request to an application gateway, it
    resolves the domain name of the application gateway by using a Domain
    Name System (DNS) server. Azure controls the DNS entry because all
    application gateways are in the azure.com domain.

  2. The Azure DNS returns the IP address to the client, which is the
    frontend IP address of the application gateway.

  3. The application gateway accepts incoming traffic on one or more
    listeners. A listener is a logical entity that checks for
    connection requests. It's configured with a frontend IP address,
    protocol, and port number for connections from clients to the
    application gateway.

  4. If a web application firewall (WAF) is in use, the application
    gateway checks the request headers and the body, if present,
    against WAF rules. This action determines if the request is valid
    request or a security threat. If the request is valid, it's routed
    to the backend. If the request isn't valid and WAF is in Prevention
    mode, it's blocked as a security threat. If it's in Detection mode,
    the request is evaluated and logged, but still forwarded to the
    backend server.

The routing to one backend or another can be based on URL Paths:

url path based routing

You can find an example of this configuration in this related Microsoft article.

In your use case, you will need to define two backends, one for every App Service, and define routing rules as appropriate.

As indicated before, your DNS should point to the Application Gateway: it will handle the routing to one or other App Service based on the route, /eu/* or /*, provided by the client.

The order of the routes is important: once a rule is matched, it will be the one processed.

Application Gateway is a regional service: Azure Front Door leverages a similar functionality (and much more) globally.

Please, consider review the associated costs of these services.

不交电费瞎发啥光 2025-02-04 09:19:15

我正在回答自己的问题,希望在同一情况下帮助其他人。这只是使用反向代理完成。本文介绍了您需要进行设置所需的一切 - https://ruslany.net/2014/05/ususion-azure-web-site-site-as-a-resverse-proxy/

I am answering my own question to hopefully help others in the same situation. This was simply done using a reverse proxy. This article explains everything you need to set it up - https://ruslany.net/2014/05/using-azure-web-site-as-a-reverse-proxy/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文