gateway 网关 路由新增 (已亲测)

问题:

前端通过gateway调用后端接口,路由转发失败,提示404 not found

排查:

使用 { "href":"/actuator/gateway/routes", "methods":[ "POST", "GET" ] } 命令查看路由列表,确实缺少路由信息

curl -v http://127.0.0.1:9090/actuator/gateway/routes >> 123.txt

输出到 123.txt 文件

处理方式:

1、 手动刷新

{ "href":"/actuator/gateway/refresh", "methods":[ "POST" ] }

2、 手动添加

{ "href":"/actuator/gateway/routes/route-id-1", "methods":[ "POST", "DELETE", "GET" ] }

官方说明:

To create a route definition, make a POST request to /gateway/routes/{id_route_to_create} with a JSON body that specifies the fields of the route (see Retrieving Information about a Particular Route).

To delete a route definition, make a DELETE request to /gateway/routes/{id_route_to_delete}.

官网地址:
Spring Cloud Gateway

操作截图:

相关推荐
debug 小菜鸟2 天前
Python + Flask + API Gateway + Lambda + EKS 实战
python·flask·gateway
Li zlun2 天前
Kubernetes 进阶实战:CRD、Gateway API 与优先级调度
java·kubernetes·gateway
zzz.102 天前
k8s中的Gateway API 和istio
云原生·kubernetes·gateway·istio
疯狂的维修12 天前
关于Gateway configration studio软件配置网关
网络协议·c#·自动化·gateway
hadage23312 天前
--- 统一请求入口 Gateway ---
gateway
波波烤鸭14 天前
深入理解 Gateway 网关:原理、源码解析与最佳实践
java·spring·gateway
DO_Community14 天前
DigitalOcean Kubernetes 现已支持 Gateway API 托管服务
容器·kubernetes·gateway
T_Ghost14 天前
SpringCloud微服务网关Gateway
spring cloud·微服务·gateway
Rysxt_16 天前
Spring Boot Gateway 教程:从入门到精通
spring boot·网关·gateway
月夕·花晨16 天前
Gateway -网关
java·服务器·分布式·后端·spring cloud·微服务·gateway