Azure Front Door 不在浏览器中维护自定义域 [英] Azure Front Door Is Not Maintaining Custom Domain in Browser

查看:31
本文介绍了Azure Front Door 不在浏览器中维护自定义域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure Front Door 中的域:
www.foobar.com

Domain in Azure Front Door:
www.foobar.com

Azure Web 应用:
foobar-web
foobar-api

Azure Web Apps:
foobar-web
foobar-api

我希望能够让 www.foobar.com 拉起网络应用程序 foobar-web 并使用 /api用于访问网络应用 foobar-api 的 url.

I would like to be able to have www.foobar.com pull up the web app foobar-web and utilize /api in the url to access the web app foobar-api.

www.foobar.com -> foobar-web
www.foobar.com/api -> foobar-api

我为每个设置和路由规则设置了后端池.每次我尝试导航到 www.foobar.com/api 时,浏览器中的 url 都会更改为 foobar-api.azurewebsites.net/api,但是如果我导航到 www.foobar.com in 拉起 foobar-web 网络应用程序,同时在浏览器中维护 www.foobar.com 域.

I have a backend pool setup for each and route rules setup. Each time I try navigating to www.foobar.com/api the url in the browser changes to foobar-api.azurewebsites.net/api, but if I navigate to www.foobar.com in pulls up the foobar-web web app while maintaining the www.foobar.com domain in the browser.

Azure Front Door 中是否有我遗漏的设置或需要在 Web 应用或源代码中配置以维护域的内容?

Is there a setting in Azure Front Door that I am missing or something that needs to be configured in the web app or source code to maintain the domain?

Web 应用程序是 C# ASP.NET Web API 2 解决方案.

The web app is a C# ASP.NET Web API 2 solution.

预先感谢您提供任何答案/建议.

Thank you in advance for any answers/suggestions.

推荐答案

最新

API 的 API 路由规则要求您在项目中定义自己的路由规则.此处显示的示例仅为示例代码.

The API routing rules for APIs require you to define your own in the project. The examples shown here are only sample code.

我在前门的设置.

隐私

经过测试,我使用虚拟应用程序来满足您的需求.

After my testing, I used Virtual applications to fulfill your needs.

下面的截图是我的项目结构.

The screenshot below is my project structure.

在部署应用之前,您需要修改 .csproj 文件.一般只需要修改foobar-api项目即可,如果部署失败可以同时修改两个项目.

Before you deploy your app, you need to modify .csproj file. Generally, you just need to modify foobar-api project, if deploy failed you can modify both two projects.

<PropertyGroup>
    <TargetFramework>netcoreapp3.1</TargetFramework>
    <RootNamespace>foobar_web</RootNamespace>
    <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
    <AspNetCoreModuleName>AspNetCoreModule</AspNetCoreModuleName>
</PropertyGroup>

然后就可以部署了,我在foobar-api项目中创建了test/aa.

Then you can deploy it, I create test/aa in foobar-api project.

网页

虚拟应用索引

虚拟应用程序中的 Api 测试

创建前门服务后,配置完成后.

After creating the front door service, after the configuration is complete.

网页

API

这篇关于Azure Front Door 不在浏览器中维护自定义域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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