Files
flagnote-config/src/main/resources/configs/flagnote-gateway-dev.yml

189 lines
6.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server:
# address: 127.0.0.1
port: 21000
spring:
data:
redis:
database: 10
host: localhost
port: 6379
timeout: 10000
poolMaxTotal: 10
poolMaxIdle: 10
poolMaxWait: 3
password: redispassword
codec:
max-in-memory-size: 10MB
servlet:
multipart:
# 最大支持文件大小
max-file-size: 10MB
# 最大支持请求大小
max-request-size: 10MB
cloud:
gateway:
routes:
- id: redirect
uri: lb://flagnote-service
order: -1
predicates:
- Path=/html/redirect
- Method=GET
filters:
- name: RequestRateLimiter
args:
# 如果返回的key是空的话false则不进行限流
# deny-empty-key: true
# status-code: TOO_MANY_REQUESTS
# 每秒产生多少个令牌
redis-rate-limiter.replenishRate: 1
# 1秒内最大的令牌即在1s内可以允许的突发流程设置为0表示阻止所有的请求
redis-rate-limiter.burstCapacity: 10
# 每次请求申请几个令牌
redis-rate-limiter.requestedTokens: 1
# IP 地址限流
key-resolver: "#{@remoteAddrKeyResolver}"
- name: RequestRateLimiter
args:
# 如果返回的key是空的话false则不进行限流
# deny-empty-key: true
# status-code: TOO_MANY_REQUESTS
# 每秒产生多少个令牌
redis-rate-limiter.replenishRate: 1
# 1秒内最大的令牌即在1s内可以允许的突发流程设置为0表示阻止所有的请求
redis-rate-limiter.burstCapacity: 10
# 每次请求申请几个令牌
redis-rate-limiter.requestedTokens: 2
# IP 地址限流
key-resolver: "#{@remoteSessionKeyResolver}"
- id: keyMeta
uri: lb://flagnote-service
order: -1
predicates:
- Path=/note/keyMeta
- Method=GET
filters:
- name: RequestRateLimiter
args:
# 如果返回的key是空的话false则不进行限流
# deny-empty-key: true
# status-code: TOO_MANY_REQUESTS
# 每秒产生多少个令牌
redis-rate-limiter.replenishRate: 1
# 1秒内最大的令牌即在1s内可以允许的突发流程设置为0表示阻止所有的请求
redis-rate-limiter.burstCapacity: 10
# 每次请求申请几个令牌
redis-rate-limiter.requestedTokens: 1
# IP 地址限流
key-resolver: "#{@remoteAddrKeyResolver}"
- name: RequestRateLimiter
args:
# 如果返回的key是空的话false则不进行限流
# deny-empty-key: true
# status-code: TOO_MANY_REQUESTS
# 每秒产生多少个令牌
redis-rate-limiter.replenishRate: 1
# 1秒内最大的令牌即在1s内可以允许的突发流程设置为0表示阻止所有的请求
redis-rate-limiter.burstCapacity: 10
# 每次请求申请几个令牌
redis-rate-limiter.requestedTokens: 2
# IP 地址限流
key-resolver: "#{@remoteSessionKeyResolver}"
- id: noteMeta
uri: lb://flagnote-service
order: -1
predicates:
- Path=/note/{key:[abcdefhikmnopqstuvwxyz23456789]{16}}/noteMeta
- Method=GET
filters:
- ValidateNoteKey
- id: getNote
uri: lb://flagnote-service
order: -1
predicates:
- Path=/note/{key:[abcdefhikmnopqstuvwxyz23456789]{16}}
- Method=GET
filters:
- ValidateNoteKey
- id: saveNote
uri: lb://flagnote-service
order: -1
predicates:
- Path=/note/{key:[abcdefhikmnopqstuvwxyz23456789]{16}}
- Method=POST
filters:
- ValidateNoteKey
- id: deleteNote
uri: lb://flagnote-service
order: -1
predicates:
- Path=/note/{key:[abcdefhikmnopqstuvwxyz23456789]{16}}/delete
- Method=POST
filters:
- ValidateNoteKey
- id: secretKey
uri: lb://flagnote-service
order: -1
predicates:
- Path=/note/{key:[abcdefhikmnopqstuvwxyz23456789]{16}}/secretKey
- Method=POST
filters:
- ValidateNoteKey
- id: getNoteTxt
uri: lb://flagnote-service
order: -1
predicates:
- Path=/note/{key:[abcdefhikmnopqstuvwxyz23456789]{16}}.txt
- Method=GET
filters:
- ValidateNoteKey
zookeeper:
connect-string: localhost:2181
discovery:
enabled: true
loadbalancer:
configurations: health-check
health-check:
path:
noteCommonService: /xxxxxx/actuator/health
keyMetaService: /xxxxxx/actuator/health
initial-delay: 0
interval: 5s
inetutils:
# 指定此客户端的ip
default-ip-address: localhost
management:
# server:
# address: 127.0.0.1
# port: 19000
endpoint:
shutdown:
enabled: true
health:
enabled: true
show-details: always
endpoints:
web:
base-path: /xxxxxx/actuator
exposure:
include: shutdown,health
logging:
level:
org.springframework.cloud.gateway: trace
org.springframework.cloud.loadbalancer: trace
org.springframework.web.reactive: trace