chenhaozhe
2026-11-11 4837024d8cd40e31bb4b95cbeec0ae473dfca4e3
appsettings.json
@@ -9,7 +9,18 @@
  "Gateway": {
    "FileFilter": {
      "Enabled": true,
      "BlockedExtensions": [ ".dll", ".log" ]
      "BlockedExtensions": [ ".dll", ".log", ".config" ]
    },
    "FolderFilter": {
      "Enabled": true,
      // BlockedFolders 中的key 全部配置为小写字母
      "BlockedFolders": {
        "bin": 1,
        "obj": 1,
        "vlog": 1,
        "dll": 1,
        "PageLogs": 1
      }
    },
    "ErrorPage": {
      "Enabled": true,
@@ -21,6 +32,7 @@
    "Routes": {
      "mes-backend": {
        "ClusterId": "mes-backend",
        "CorsPolicy": "frontend-dev",
        "Match": {
          "Path": "/API/{**catch-all}"
        },
@@ -33,10 +45,13 @@
      "mes-backend": {
        "Destinations": {
          "backend": {
            "Address": "http://localhost:81"
            "Address": "http://127.0.0.1:81"
          }
        }
      }
    }
    // 注意:YARP 没有 "CorsPolicies" 这个配置节(写了也会被静默忽略)。
    // 路由上的 "CorsPolicy" 只是策略名,真正的策略定义在 Program.cs 的 AddCors(...) 里,
    // 两处名字必须完全一致。
  }
}
}