gpt4 book ai didi

Azure 应用程序网关缺少前向 header

转载 作者:行者123 更新时间:2023-12-02 06:00:48 27 4
gpt4 key购买 nike

我已在 Azure 应用服务上运行的 asp.net Web api 前面设置了一个 Azure 应用网关 WAF v2 实例。为了使其正常工作,我必须在 AG 规则的后端设置中打开以下选项:

Azure App Gateway Backend Setting

我有Http Logging在我的 asp.net web api 中打开。我正在尝试对 header 进行调试/故障排除,以确定如何让 NSwag 呈现正确的服务器和基本 url,但是根据this article,我没有看到任何以下 header 存在。应存在:

  • x-转发-for
  • x-forwarded-proto

我确实看到了以下标题:

  • x-原始-for
  • x-原始原型(prototype)
  • x-原始主机
  • x-原始网址

对于缺少什么有什么想法吗?

谢谢!

最佳答案

应用程序网关应默认发送这些 header ,但应用程序服务默认情况下不会读取它们。

In some configurations, the App Service is using the App Service FQDN as the redirect URI instead of the Front Door FQDN. This will lead to an issue when the client is being redirected to App Service instead of Front Door. To change that, the forwardProxy setting needs to be set to Standard to make App Service respect the X-Forwarded-Host header set by Azure Front Door.

对于应用程序网关来说也是如此。

需要在命令行中更改配置,或者直接编辑应用服务的 json 配置。

considerations-when-using-azure-front-door

关于Azure 应用程序网关缺少前向 header ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72193138/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com