如何将 Azure App Services 域用于静态 Web 应用程序?

How to use Azure App Services domain for Static Web Apps?

我有一个 Azure 应用服务实例,默认情况下转到 https://myappservice.azurewebsites.net (not actually mine, but it's the same format). It's not a bad domain and a lot better than the sporadic randomized domains from Static Web Apps (https://lively-tree-randomletters.azurestaticapps.net)。

有什么方法可以将静态 Web 应用程序上的无服务器网站 运行 切换为也使用 https://myappservice.azurewebsites.net 域?

或者是托管 (1) react 和 (2) spring 在同一域上启动的唯一可能解决方案,买一个?或者这根本不可能?

(我希望它们在同一个域中,这样我就不必担心 CORS)

我认为您可以使用 Application Gateway 来解决这个问题。使用应用程序网关,您可以设置 path-based 规则,以便您同时获得应用服务和静态网站,但请说您的网站。com/sprintBoot 将路由到您的应用服务以及 yoursite.com, 到您的静态网站。

以这篇文章为例:Create an application gateway with path-based routing rules using the Azure portal

虽然这是否比担心 CORS 更容易,但还有待讨论。