-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsystem-gateway-server-dev.yml
95 lines (90 loc) · 2.5 KB
/
system-gateway-server-dev.yml
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
90
91
92
93
94
95
server:
port: 1003
spring:
rabbitmq:
host: 127.0.0.1
port: 5672
username: guest
password: guest
zipkin:
rabbitmq:
queue: zipkin
sleuth:
sampler:
percentage: 1.0 #日志记录发送给采集器的概率,配置成1全量收集日志
zuul:
ribbon:
eager-load:
enabled: true #开启Ribbon的饥饿加载模式
clients: system-auth-server,business-admin-server,business-pay-server #指定需要饥饿加载的客户端名称、服务名
ignoredServices: '*'
host:
connect-timeout-millis: 30000
socket-timeout-millis: 30000
routes:
system-auth-server:
path: /auth/**
serviceId: system-auth-server
stripPrefix: true
sensitiveHeaders:
business-admin-server:
path: /admin/**
serviceId: business-admin-server
stripPrefix: true
sensitiveHeaders:
business-pay-server:
path: /pay/**
serviceId: business-pay-server
stripPrefix: true
sensitiveHeaders:
ratelimit:
key-prefix: business-ratelimite
enabled: true
repository: REDIS
behind-proxy: true
policies:
business-admin-server:
limit: 100
quota: 100
refresh-interval: 3 #3秒内允许300个访问,平均每个请求2秒,并且要求总请求时间小于2400秒
security:
validate:
code: false
sessions: stateless
oauth2:
client:
client-id: ENC(eZLNwFxeSKENBh1pu/M/rMMB76nxo/RLhWSaSLHa8+0=)
client-secret: ENC(sKbpJGHz9JZmdydv1WOyAYjyXm2irxc0xYqvQ6VpF31uEw/FVNxYeA==)
resource:
loadBalanced: true
token-info-uri: ${security.auth.server}/oauth/check-token #由资源服务器用来解码访问令牌
service-id: system-gateway-server
jwt:
#key-uri: ${security.auth.server}/oauth/token_key #使用JWT令牌,RSA公开密钥可以用于令牌验证
key-value: ENC(fmVD9Jt6YXP9Q+KBPU8/1cWgKn5WhlGuD10SzFADNz4=)
#security:
# validate:
# code: false
# sessions: stateless
# oauth2:
# resource:
# loadBalanced: true
# user-info-uri: http://system-auth-server/user
# prefer-token-info: false
# service-id: system-gateway-server
# 上述做法将权限认证和网关解耦、建议采用RSA加密验证方式
urls:
collects:
- /mobile/**
- /auth/**
- /admin/code/*
- /admin/api/info
- /admin/api/userTree
- /admin/api/dictType/*
- /swagger-resources/**
- /swagger-ui.html
- /*/v2/api-docs
- /swagger/api-docs
- /webjars/**
logging:
config: classpath:logback.xml