104 lines
2.3 KiB
YAML

server:
port: 8080
spring:
application:
name: fund-gateway
# Redis配置(用于限流)
data:
redis:
host: localhost
port: 6379
password: zjf@123456
database: 1
cloud:
compatibility-verifier:
enabled: false
# Sentinel配置
sentinel:
transport:
dashboard: localhost:8080 # Sentinel Dashboard地址(可选)
port: 8719 # Sentinel客户端端口
eager: true # 服务启动时立即初始化
gateway:
# 默认限流配置
default-filters:
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 100 # 每秒补充令牌数
redis-rate-limiter.burstCapacity: 200 # 令牌桶最大容量
key-resolver: "#{@ipKeyResolver}"
routes:
# 系统管理服务
- id: fund-sys
uri: http://localhost:8100
predicates:
- Path=/sys/**
filters:
- StripPrefix=1
# 客户管理服务
- id: fund-cust
uri: http://localhost:8110
predicates:
- Path=/cust/**
filters:
- StripPrefix=1
# 项目管理服务
- id: fund-proj
uri: http://localhost:8120
predicates:
- Path=/proj/**
filters:
- StripPrefix=1
# 用款申请服务
- id: fund-req
uri: http://localhost:8130
predicates:
- Path=/req/**
filters:
- StripPrefix=1
# 支出管理服务
- id: fund-exp
uri: http://localhost:8140
predicates:
- Path=/exp/**
filters:
- StripPrefix=1
# 收款管理服务
- id: fund-receipt
uri: http://localhost:8150
predicates:
- Path=/receipt/**
filters:
- StripPrefix=1
# 报表服务
- id: fund-report
uri: http://localhost:8160
predicates:
- Path=/report/**
filters:
- StripPrefix=1
# 文件服务
- id: fund-file
uri: http://localhost:8170
predicates:
- Path=/file/**
filters:
- StripPrefix=1
logging:
level:
org.springframework.cloud.gateway: DEBUG