nacos中网关的配置如下
server:
port: 18600
spring:
cloud:
sentinel:
app:
#标识网关项目
type: 1
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 10.xxx.xxx.4:8088
#网关ip
client-ip: 10.xxx.xxx.4
# nacos配置持久化
datasource:
ds-flow:
nacos:
server-addr: 10.xxx.xxx.4:xxxx
namespace: ed2c5b61-68c2-4c07-8446-37bcc9064e0a
dataId: sentinel-pojo-gateway
groupId: DEFAULT_GROUP
data-type: json
#流控规则
rule-type: flow
username: nacos
password: yuanhangXXXXX
ds-degrade:
nacos:
server-addr: 10.xxx.xxx.4:xxxx
namespace: ed2c5b61-68c2-4c07-8446-37bcc9064e0a
dataId: sentinel-degrade-gateway
groupId: DEFAULT_GROUP
data-type: json
#熔断规则
rule-type: degrade
username: nacos
password: yuanhangXXXXX
gateway:
discovery:
locator:
lowerCaseServiceId: true
enabled: true
routes:
# 认证中心
- id: yh-platform-auth
uri: lb://yh-platform-auth
predicates:
- Path=/auth/**
filters:
# 验证码处理
- CacheRequestFilter
- StripPrefix=1
# 系统模块
- id: yh-platform-system
uri: lb://yh-platform-system
predicates:
- Path=/system/**
filters:
- StripPrefix=1
# 文件服务
- id: yh-platform-file
uri: lb://yh-platform-file
predicates:
- Path=/file/**
filters:
- StripPrefix=1
# hkhj
- id: yh-platform-prj
uri: lb://yh-platform-prj
predicates:
- Path=/prj/**
filters:
- StripPrefix=1
# 不校验白名单
ignore:
whites:
- /auth/login
- /csrf
- /auth/logoutApp
- /auth/loginApp