nacos_DEMO_gsc-gateway-dev.yml
2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
server:
port: 9898
spring:
data:
redis:
host: 192.168.3.226
port: 6379
# 用户名密码如果没有配置,配置项注释掉
# username:
# password:
database: 0
timeout: 30000
connectTimeout: 30000
cloud:
gateway:
sign:
# 验签密钥对配置
kay-pairs:
# 前端业务模块:秘钥
dj_zhixin: "c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b"
client2: "b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8"
# 排除路径(不需要验签的路径)
excluded-path:
- "/swagger-ui/index.html"
# 包含路径(不需要验签的路径)
excludedContainPath:
- "/v3/api-docs"
# 正则匹配(不需要验签的路径)
excludedRegexPath:
- "/v3/api-docs"
# 请求超时时间(毫秒),默认5分钟
request-timeout: 300000 # 5 * 60 * 1000
# 全局跨域配置
globalcors:
cors-configurations:
'[/**]':
allowed-origins: "*"
allowed-methods:
- GET
- POST
- PUT
- DELETE
- OPTIONS
allowed-headers: "*"
# 设置为 true 时,allowed-origins 不能设置为 "*",需要指定具体的域名
allow-credentials: false
max-age: 3600
server:
webflux:
routes:
- id: gsc-upms-facade
uri: lb://gsc-upms-facade
predicates:
- Path=/facade/**
filters:
# 限流配置
- name: RequestRateLimiter
args:
key-resolver: '#{@remoteAddrKeyResolver}'
redis-rate-limiter.replenishRate: 100
redis-rate-limiter.burstCapacity: 200
#UPMS 模块
- id: gsc-upms-biz
uri: lb://gsc-upms-biz
predicates:
- Path=/admin/**
filters:
# 限流配置
- name: RequestRateLimiter
args:
key-resolver: '#{@remoteAddrKeyResolver}'
redis-rate-limiter.replenishRate: 100
redis-rate-limiter.burstCapacity: 200
# 固定路由转发配置 无修改
- id: openapi
uri: lb://gsc-gateway
predicates:
- Path=/v3/api-docs/**
filters:
- RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/$\{path}/v3/api-docs
swagger:
enabled: true
title: gsc Swagger API
gateway: http://${GATEWAY-HOST:127.0.0.1}:${GATEWAY-PORT:9999}
token-url: ${swagger.gateway}/auth/oauth2/token
scope: server