1、nginx 代理了后端网关地址时配置了 /api 如下:
location /api {
proxy_pass http://127.0.0.1:21212;
}
2、gateway 配置如下:
routes:
- id: system-server
uri: lb://intelligent-system
predicates:
- Path=/api/system/**,
filters:
- DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin
- StripPrefix=1
主要增加的就是 path /api 与 StripPrefix 两个