chenhaozhe
2026-11-11 5441ea196175b8a722632ad0b64ec8ff33209373
appsettings.json
@@ -6,15 +6,27 @@
    }
  },
  "AllowedHosts": "*",
  "Gateway": {
    "FileFilter": {
      "Enabled": true,
      "BlockedExtensions": [ ".dll", ".log" ]
    },
    "ErrorPage": {
      "Enabled": true,
      "LogPageEnabled": true,
      "LogPageDirectory": "PageLogs"
    }
  },
  "ReverseProxy": {
    "Routes": {
      "mes-backend": {
        "ClusterId": "mes-backend",
        "CorsPolicy": "frontend-dev",
        "Match": {
          "Path": "/API_NW/{**catch-all}"
          "Path": "/API/{**catch-all}"
        },
        "Transforms": [
          { "PathRemovePrefix": "/API_NW" }
          //{ "PathRemovePrefix": "/API" }
        ]
      }
    },
@@ -22,10 +34,13 @@
      "mes-backend": {
        "Destinations": {
          "backend": {
            "Address": "http://localhost:8090"
            "Address": "http://localhost:81"
          }
        }
      }
    }
    // 注意:YARP 没有 "CorsPolicies" 这个配置节(写了也会被静默忽略)。
    // 路由上的 "CorsPolicy" 只是策略名,真正的策略定义在 Program.cs 的 AddCors(...) 里,
    // 两处名字必须完全一致。
  }
}
}