| | |
| | | } |
| | | }, |
| | | "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" } |
| | | ] |
| | | } |
| | | }, |
| | |
| | | "mes-backend": { |
| | | "Destinations": { |
| | | "backend": { |
| | | "Address": "http://localhost:8090" |
| | | "Address": "http://localhost:81" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 注意:YARP 没有 "CorsPolicies" 这个配置节(写了也会被静默忽略)。 |
| | | // 路由上的 "CorsPolicy" 只是策略名,真正的策略定义在 Program.cs 的 AddCors(...) 里, |
| | | // 两处名字必须完全一致。 |
| | | } |
| | | } |
| | | } |