You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.0 KiB
32 lines
1.0 KiB
spring:
|
|
cloud:
|
|
gateway:
|
|
routes:
|
|
- id: pms_route
|
|
uri: lb://xujie-pms
|
|
predicates:
|
|
- Path=/api/pms/**
|
|
filters:
|
|
- RewritePath=/api/(?<segment>/?.*),/$\{segment}
|
|
|
|
- id: qm_route
|
|
uri: lb://xujie-qm
|
|
predicates:
|
|
- Path=/api/qm/**
|
|
filters:
|
|
- RewritePath=/api/(?<segment>/?.*),/$\{segment}
|
|
|
|
- id: sys_route
|
|
uri: lb://xujie-sys # lb 负载均衡到 xujie-sys服务
|
|
predicates: # 断言
|
|
- Path=/api/** # api开头的请求
|
|
filters: #该RewritePath GatewayFilter工厂采用的路径regexp参数和replacement参数。这使用 Java 正则表达式来灵活地重写请求路径。以下清单配置了一个RewritePath GatewayFilter:
|
|
- RewritePath=/api/(?<segment>/?.*),/$\{segment}
|
|
nacos:
|
|
discovery:
|
|
server-addr: 192.168.1.83:8848
|
|
ip: 127.0.0.1
|
|
application:
|
|
name: xujie-gateway
|
|
server:
|
|
port: 88
|