spring: cloud: gateway: globalcors: corsConfigurations: '[/**]': allowedOriginPatterns: "*" allowed-methods: "*" allowed-headers: "*" allow-credentials: true exposedHeaders: "Content-Disposition,Content-Type,Cache-Control" discovery: locator: lowerCaseServiceId: true enabled: true routes: # 认证中心 - id: soc-auth uri: lb://soc-auth predicates: - Path=/auth/** filters: # 验证码处理 - CacheRequestFilter - ValidateCodeFilter - StripPrefix=1 # 代码生成 - id: soc-gen uri: lb://soc-gen predicates: - Path=/code/*/* filters: - StripPrefix=1 # 定时任务 - id: soc-job uri: lb://soc-job predicates: - Path=/schedule/** filters: - StripPrefix=1 # 系统模块 - id: soc-system uri: lb://soc-system predicates: - Path=/system/** filters: - StripPrefix=1 # 文件服务 - id: soc-file uri: lb://soc-file predicates: - Path=/file/** filters: - StripPrefix=1 # 核心服务 - id: soc-core uri: lb://soc-core predicates: - Path=/core/** filters: - StripPrefix=1 # 同步服务 - id: soc-sync uri: lb://soc-sync predicates: - Path=/sync/** filters: - StripPrefix=1 # 北向服务 - id: soc-mediator uri: lb://soc-mediator predicates: - Path=/mediator/** filters: - StripPrefix=1 - id: soc-iot uri: lb://soc-iot predicates: - Path=/iot/** filters: - StripPrefix=1 # 短信服务 - id: soc-sms uri: lb://soc-sms predicates: - Path=/sms/** filters: - StripPrefix=1 # 部署中心服务 - id: soc-deploy uri: lb://soc-deploy predicates: - Path=/api/deploy/** filters: - StripPrefix=2 # websocket模块 - id: soc-websocket uri: lb:ws://soc-system predicates: - Path=/websocket/** - id: soc-websocket uri: lb:ws://soc-mediator predicates: - Path=/ws/** - id: soc-websocket uri: lb:ws://soc-mediator predicates: - Path=/ws1/** - id: soc-host uri: lb:ws://soc-host predicates: - Path=/host/** - id: soc-host uri: lb:ws://soc-host predicates: - Path=/host1/** # 安全配置 security: # 验证码 captcha: enabled: false type: math # 防止XSS攻击 xss: enabled: true excludeUrls: - /system/notice - /system/config # 不校验白名单 ignore: whites: - /auth/logout - /auth/logoutApp - /auth/tokenlogin - /auth/login - /auth/loginApp - /auth/register - /*/v2/api-docs - /csrf - /mediator/** - /system/version/checkUpdate - /system/version/download/* - /file/file/getFile/* - /api/deploy/register - /api/deploy/accesstoken - /api/deploy/package/download/** - /api/deploy/agent/download/** - /api/deploy/frontend/synchronDate - /api/deploy/heartbeat - /api/deploy/list - /api/deploy/report - /api/deploy/task - /api/deploy/taskReport - /ws/** - /ws1/** - /host/** - /host1/**