You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure App Service中添加的apple-app-site-association文件无法访问

解决Azure App Service中无扩展名apple-app-site-association文件404问题

方案1:通过Kudu编辑现有web.config

即便应用是ACS生成的,仍可尝试通过Kudu控制台修改web.config:

  • 访问https://<你的App Service名称>.scm.azurewebsites.net登录Kudu
  • 进入Debug console -> CMD或PowerShell,找到站点根目录下的web.config
  • 在<system.webServer>节点内添加以下规则,保存后重启App Service:
<staticContent>
  <mimeMap fileExtension="." mimeType="application/json" />
</staticContent>
<rewrite>
  <rules>
    <rule name="apple-app-site-association" stopProcessing="true">
      <match url="^.well-known/apple-app-site-association$" />
      <action type="Rewrite" url="/.well-known/apple-app-site-association" />
    </rule>
  </rules>
</rewrite>

方案2:通过Azure门户配置全局MIME类型

无需修改web.config,直接在门户配置:

  • 进入目标App Service -> 左侧菜单配置 -> 常规设置
  • 找到MIME类型区域,点击添加
  • 输入:
    • 扩展名:.
    • MIME类型:application/json
  • 保存配置,等待应用重启后测试访问

方案3:通过Azure CLI配置MIME类型

用CLI命令快速配置:

az webapp config set --name <你的App Service名称> --resource-group <资源组名称> --mime-types '.'='application/json'

执行后重启应用:

az webapp restart --name <你的App Service名称> --resource-group <资源组名称>

方案4:验证文件路径与权限

  • 确认文件准确位于/.well-known/目录下,文件名完全为apple-app-site-association(无任何扩展名,可在Kudu中查看文件属性确认)
  • 检查文件权限:在Kudu中右键文件选择Properties,确保权限为644或其他可读权限

内容的提问来源于stack exchange,提问作者David Shochet

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.24 14:44:55