69 lines
1.9 KiB
YAML
69 lines
1.9 KiB
YAML
server:
|
||
port: 8081
|
||
spring:
|
||
profiles:
|
||
# 环境配置
|
||
active: dev
|
||
application:
|
||
name: qiuguo-iot-gateway
|
||
cloud:
|
||
nacos:
|
||
discovery:
|
||
# 服务注册地址iot-nacos.qiuguo-iot
|
||
server-addr: 192.168.8.146:32470
|
||
config:
|
||
# 配置中心地址
|
||
server-addr: 192.168.8.146:32470
|
||
# 配置文件格式
|
||
file-extension: yml
|
||
# 共享配置
|
||
shared-configs:
|
||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||
gateway:
|
||
discovery:
|
||
locator:
|
||
# 开启服务发现
|
||
enabled: true
|
||
# 忽略注册中心服务的大小写
|
||
lower-case-service-id: true
|
||
globalcors:
|
||
corsConfigurations:
|
||
'[/**]':
|
||
# 允许携带认证信息
|
||
allow-credentials: true
|
||
# 允许跨域的源(网站域名/ip),设置*为全部
|
||
allowedOriginPatterns: "*"
|
||
# 允许跨域的method, 默认为GET和OPTIONS,设置*为全部
|
||
allowedMethods: "*"
|
||
# 允许跨域请求里的head字段,设置*为全部
|
||
allowedHeaders: "*"
|
||
routes:
|
||
# # 系统服务
|
||
# - id: qiuguo-iot-box-user-api
|
||
# # 匹配后路由地址
|
||
# uri: lb://qiuguo-iot-box-user-api
|
||
# # 断言,路径相匹配的进行路由
|
||
# predicates:
|
||
# - Path=/qiuguo-iot-box-user-api/**
|
||
# filters:
|
||
# # 转发时去掉一层路径
|
||
# - StripPrefix=1
|
||
- id: qiuguo-iot-box-user-api
|
||
uri: http://192.168.8.199:8080
|
||
predicates:
|
||
- Path=/iot-user/**
|
||
|
||
# 安全配置
|
||
security:
|
||
# 防止XSS攻击
|
||
xss:
|
||
enabled: true
|
||
# 排除的路径
|
||
exclude-urls:
|
||
- /iot-user/user/user/login/pwd
|
||
#application:
|
||
# cors:
|
||
# allowed-crigin-patterns:
|
||
# - /iot-user/user/user/login/pwd
|
||
|