GJGJJ/gateway/config/application-dcim.yml

107 lines
3.5 KiB
YAML
Raw Permalink 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.

spring:
# redis配置
data:
redis:
database: 0
password: tjjt1234
sentinel:
master: jtredis
nodes: 10.7.248.82:26379,10.7.248.83:26379,10.7.248.84:26379
cloud:
nacos:
discovery:
# 如果使用nacos集群则将所有集群节点的ip:port用逗号连接写在此处
server-addr: 10.7.248.82:8848,10.7.248.83:8848,10.7.248.84:8848
username: nacos
password: nacos
namespace: springboot3
# 多网卡时需要指定一下取本地的哪个ip
ip: 10.6.8.104
gateway:
default-filters:
# 熔断降级配置
- name: CircuitBreaker
args:
name: default
fallbackUri: 'forward:/defaultfallback'
#redis限流 filter名称必须是RequestRateLimiter
- name: RequestRateLimiter
args:
# 使用SpEL名称引用Bean与上面新建的RateLimiterConfig类中的bean的name相同
key-resolver: '#{@remoteIpKeyResolver}'
# 每秒最大访问次数
'[redis-rate-limiter.replenishRate]': 100
# 令牌桶最大容量,允许在一秒钟内完成的最大请求数
'[redis-rate-limiter.burstCapacity]': 100
# 结合注册中心,为所有服务进行路由转发
discovery:
locator:
enabled: true
#服务ID大小写false为大写true为小写eureka中可以使用大写路径匹配小写所以为false其他的设置为true
lower-case-service-id: true
routes:
- id: message-queue
uri: lb://message-queue
predicates:
- Path=/websocket/**
- id: message-queue
uri: lb:ws://message-queue
predicates:
- Path=/websocket/**
#security资源服务器配置
security:
oauth2:
resourceserver:
#spring security oauth2默认用的就是这个token但网上资料很少网上用的都是jwt
opaquetoken:
client-id: test
client-secret: test
#这个就是验证token的地址坑了我好久网上都没找到说明
#introspection-uri: http://localhost:${server.port}/dcim-oauth/oauth2/introspect
# introspection-uri: http://dcim-oauth/oauth2/introspect
introspection-uri: http://jt-oauth/oauth2/introspect
resilience4j:
timelimiter:
configs:
default:
timeoutDuration: 6000ms
netpro:
gateway:
dynamic-route:
loadblance: true
url: http://dems-baseconfig-jafey/collector/route
security:
white-list:
- /dcim-common/appInfo/hadApp
- /dcim-oauth/oauth2/token
- /dcim-oauth/oauth2/introspect
- /dcim-oauth/auth/logout
- /jt-oauth/oauth2/token
- /jt-oauth/oauth2/introspect
- /jt-oauth/auth/logout
- /message-queue/websocket/**
- /*/websocket/**
- /dems-baseconfig/showObjectData/**
- /file-manage/file/v2/download/**
- /file-manage/file/v2/downloadByMap/**
- /dems-mcgs/static/**
- /dems-mcgs/zutaiLogin
- /dems-mcgs/dems/login
- /eam-baseconfig/measureDeviceRecord/getUploadFile/**
- /health
- /actuator/**
- /route/save
- /defaultfallback
- /test
redirect-map:
"[/dems-mcgs/zutaiIndex]": /dems-mcgs/zutaiLogin
management:
endpoint:
gateway:
enabled: true
endpoints:
web:
exposure:
include: gateway