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

基于Azure Web App部署Flutter Web时的内部路由重定向问题

Flutter Web部署Azure Web App(Linux)内部路由问题

我尝试通过Azure Web App部署Flutter Web应用,目前遇到内部路由问题。使用的是Linux操作系统的Azure App Service,已配置以下配置文件:

web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Redirect to New Site" stopProcessing="true">
                     <match url=".*" />
                     <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.html" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

staticwebapp.config.json

{
    "routes": [
        {
            "route": "/*",
            "redirect": "/index.html",
            "statusCode": 200
        }
    ]
}

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.05 08:03:11