|
@@ -1,236 +0,0 @@
|
|
|
-server:
|
|
|
|
|
- port: 6000
|
|
|
|
|
-spring:
|
|
|
|
|
- threads:
|
|
|
|
|
- virtual:
|
|
|
|
|
- enabled: true
|
|
|
|
|
- application:
|
|
|
|
|
- name: gateway
|
|
|
|
|
- profiles:
|
|
|
|
|
- active: @profile.active@
|
|
|
|
|
- cloud:
|
|
|
|
|
- loadbalancer:
|
|
|
|
|
- ribbon:
|
|
|
|
|
- enabled: false
|
|
|
|
|
- gateway:
|
|
|
|
|
- # 默认过滤器(对所有 route 均生效)
|
|
|
|
|
- default-filters:
|
|
|
|
|
- # 限流配置
|
|
|
|
|
- - name: MyRequestRateLimiter
|
|
|
|
|
- args:
|
|
|
|
|
- # 如果 keyResolver 返回空 key 则拒绝请求返回 403, 默认 true 表示拒绝, false 表示允许访问
|
|
|
|
|
- deny-empty-key: false
|
|
|
|
|
- # 自定义的 KeyResolver(从请求 exchange 解析 id 来区分独立的限流单元, id 可以是 userId, remoteAddr, sessionId 等)
|
|
|
|
|
- key-resolver: "#{@keyResolver}"
|
|
|
|
|
-# rate-limiter: "#{@myRateLimiter}"
|
|
|
|
|
-# my-rate-limiter.requestedTokens: 1
|
|
|
|
|
- rate-limiter: "#{@redisRateLimiter}"
|
|
|
|
|
- # 令牌桶算法每秒补充的 token 数量(每秒的请求数量)
|
|
|
|
|
- redis-rate-limiter.replenishRate: 100
|
|
|
|
|
- # 令牌桶算法的 token 最大数量(每秒的最大请求数量)
|
|
|
|
|
- redis-rate-limiter.burstCapacity: 150
|
|
|
|
|
- # 单次请求消费的 token 数量
|
|
|
|
|
- redis-rate-limiter.requestedTokens: 1
|
|
|
|
|
- routes:
|
|
|
|
|
- - id: account-router
|
|
|
|
|
- # spring-cloud-starter-zookeeper-discovery 提供服务发现功能
|
|
|
|
|
- uri: lb://auth-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/account/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: static-router
|
|
|
|
|
- uri: lb://auth-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/dist/images/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: auth-router
|
|
|
|
|
- uri: lb://auth-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/auth/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: oauth-router
|
|
|
|
|
- uri: lb://auth-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/oauth/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: account-admin-router
|
|
|
|
|
- uri: lb://auth-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/admin/account/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: account-open-router
|
|
|
|
|
- uri: lb://auth-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/open/account/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- ###############################################################################
|
|
|
|
|
- - id: user-router
|
|
|
|
|
- uri: lb://user-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/user/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: user-admin-router
|
|
|
|
|
- uri: lb://user-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/admin/user/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- ###############################################################################
|
|
|
|
|
- - id: content-router
|
|
|
|
|
- uri: lb://content-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/content/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: content-admin-router
|
|
|
|
|
- uri: lb://content-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/admin/content/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: content-open-router
|
|
|
|
|
- uri: lb://content-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/open/content/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: timeline-router
|
|
|
|
|
- uri: lb://content-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/timeline/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: search-router
|
|
|
|
|
- uri: lb://content-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/search/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: mall-router
|
|
|
|
|
- uri: lb://content-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/mall/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: geo-router
|
|
|
|
|
- uri: lb://content-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/geo/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- ###############################################################################
|
|
|
|
|
- - id: data-router
|
|
|
|
|
- uri: lb://data-service
|
|
|
|
|
- #uri: http://192.168.0.39:6005
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/data/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- ###############################################################################
|
|
|
|
|
- - id: file-router
|
|
|
|
|
- uri: lb://file-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/file/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: file1-router
|
|
|
|
|
- uri: lb://file-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/file/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: disk-router
|
|
|
|
|
- uri: lb://file-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/disk/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: file-admin-router
|
|
|
|
|
- uri: lb://file-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/admin/file/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: file-open-router
|
|
|
|
|
- uri: lb://file-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/open/file/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: chat-router
|
|
|
|
|
- uri: lb://file-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/chat/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- ###############################################################################
|
|
|
|
|
- - id: message-websocket
|
|
|
|
|
- uri: lb:ws://message-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/ws/**
|
|
|
|
|
- - id: message-router
|
|
|
|
|
- uri: lb://message-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/message/**
|
|
|
|
|
- - id: message-admin-router
|
|
|
|
|
- uri: lb://message-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/admin/message/**
|
|
|
|
|
- - id: tnb-admin-router
|
|
|
|
|
- uri: lb://message-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/admin/tnb/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- ###############################################################################
|
|
|
|
|
- - id: log-websocket
|
|
|
|
|
- uri: lb:ws://search-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/logws/**
|
|
|
|
|
- - id: search1-router
|
|
|
|
|
- uri: lb://search-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/search1/**
|
|
|
|
|
- - id: blog-router
|
|
|
|
|
- uri: lb://search-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/blog/**
|
|
|
|
|
- - id: comment-router
|
|
|
|
|
- uri: lb://search-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/comment/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- - id: admin-router
|
|
|
|
|
- uri: lb://admin-service
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/admin1/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
- ###############################################################################
|
|
|
|
|
- - id: oss-router
|
|
|
|
|
- uri: http://127.0.0.1:8010
|
|
|
|
|
- predicates:
|
|
|
|
|
- - Path=/api/oss/**
|
|
|
|
|
- filters:
|
|
|
|
|
- - StripPrefix=0
|
|
|
|
|
-# gateway:
|
|
|
|
|
-# globalcors:
|
|
|
|
|
-# cors-configurations:
|
|
|
|
|
-# '[/**]':
|
|
|
|
|
-# allowedOrigins: "*"
|
|
|
|
|
-# allowedMethods: "*"
|
|
|
|
|
-# allowedHeaders: "*"
|
|
|
|
|
-app:
|
|
|
|
|
- resources:
|
|
|
|
|
- _api_admin_: tnb_admin
|
|
|
|
|
- _api_oss_: tnb_admin
|
|
|
|
|
- _api_blog_bg_: tnb_admin
|
|
|
|
|
- _api_disk_: tnb_disk
|
|
|