chenhaozhe
2026-11-11 4837024d8cd40e31bb4b95cbeec0ae473dfca4e3
appsettings.json
@@ -6,15 +6,38 @@
    }
  },
  "AllowedHosts": "*",
  "Gateway": {
    "FileFilter": {
      "Enabled": true,
      "BlockedExtensions": [ ".dll", ".log", ".config" ]
    },
    "FolderFilter": {
      "Enabled": true,
      // BlockedFolders 中的key 全部配置为小写字母
      "BlockedFolders": {
        "bin": 1,
        "obj": 1,
        "vlog": 1,
        "dll": 1,
        "PageLogs": 1
      }
    },
    "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 +45,13 @@
      "mes-backend": {
        "Destinations": {
          "backend": {
            "Address": "http://localhost:8090"
            "Address": "http://127.0.0.1:81"
          }
        }
      }
    }
    // 注意:YARP 没有 "CorsPolicies" 这个配置节(写了也会被静默忽略)。
    // 路由上的 "CorsPolicy" 只是策略名,真正的策略定义在 Program.cs 的 AddCors(...) 里,
    // 两处名字必须完全一致。
  }
}
}