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

操作截图:

相关推荐
研究司马懿1 天前
【云原生】Gateway API介绍
云原生·gateway
研究司马懿1 天前
【云原生】Gateway API路由、重定向、修饰符等关键操作
云原生·gateway
研究司马懿1 天前
【云原生】初识Gateway API
云原生·gateway
七夜zippoe2 天前
API网关设计模式实战 Spring Cloud Gateway路由过滤限流深度解析
java·设计模式·gateway·路由·api网关
汪碧康2 天前
一文讲解kubernetes的gateway Api的功能、架构、部署、管理及使用
云原生·容器·架构·kubernetes·gateway·kubelet·xkube
大佐不会说日语~2 天前
Docker Compose 部署 Spring Boot 应用 502 Bad Gateway 问题排查与解决
spring boot·docker·gateway·maven·故障排查
Dontla4 天前
Kubernetes流量管理双雄:Ingress与Gateway API解析(Nginx与Ingress与Gateway API的关系)
nginx·kubernetes·gateway
JavaLearnerZGQ4 天前
Gateway网关将登录用户信息传递给下游微服务(完整实现方案)
微服务·架构·gateway
Ares-Wang5 天前
网络》》BGP Border Gateway Protocol,边界网关协议
网络·gateway
一方_self6 天前
cloudflare AI gateway实战代理任意第三方大模型服务提供商
人工智能·gateway