12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- shoulder:
- log:
- enabled: false
- spring:
- cloud:
- gateway:
- discovery:
- locator:
- enabled: true #表明gateway开启服务注册和发现的功能,并且spring cloud gateway自动根据服务发现为每一个服务创建了一个router,这个router将以服务名开头的请求路径转发到对应的服务。
- lowerCaseServiceId: true #是将请求路径上的服务名配置为小写(因为服务注册的时候,向注册中心注册时将服务名转成大写的了),比如以/service-hi/*的请求路径被路由转发到服务名为service-hi的服务上。
- filters:
- - StripPrefix=1 # 去掉前缀
- x-forwarded:
- prefixEnabled: false
- routes:
- - id: storage
- uri: lb://shoulder-storage-center
- predicates:
- - Path=/file/**
- filters:
- - StripPrefix=1
- - name: Hystrix
- args:
- name: default
- fallbackUri: 'forward:/fallback'
- - id: authority
- uri: lb://shoulder-authority-server
- predicates:
- - Path=/authority/**
- filters:
- - StripPrefix=1
- - name: Hystrix
- args:
- name: default
- fallbackUri: 'forward:/fallback'
- - id: msgs
- uri: lb://shoulder-msgs-server
- predicates:
- - Path=/msgs/**
- filters:
- - StripPrefix=1
- - name: Hystrix
- args:
- name: default
- fallbackUri: 'forward:/fallback'
- - id: demo
- uri: lb://shoulder-demo-server
- predicates:
- - Path=/demo/**
- filters:
- - StripPrefix=1
- - name: Hystrix
- args:
- name: default
- fallbackUri: 'forward:/fallback'
- - id: order
- uri: lb://shoulder-order-server
- predicates:
- - Path=/order/**
- filters:
- - StripPrefix=1
- - name: Hystrix
- args:
- name: default
- fallbackUri: 'forward:/fallback'
- filters:
- - name: Hystrix
- args:
- name: default
- fallbackUri: 'forward:/fallback'
- server:
- port: 8760
- servlet:
- context-path: /api # = server.servlet.context-path
- authentication:
- user:
- header-name: token
- pub-key: client/pub.key # 解密
|