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

操作截图:

相关推荐
JJJennie7771 天前
从苹果 2026 落地场景,看系统级 Agent 时代的隐私边界与 MAI Gateway 的企业Token治理
人工智能·gateway·apple
kakawzw1 天前
微服务组件源码6——Spring Gateway
spring·gateway
白露与泡影1 天前
Java 8老系统旁路接入AI Gateway:不升级JDK也能用AI
java·人工智能·gateway
是一个Bug2 天前
Nginx 与 API Gateway:从“小区门卫”到“商场总服务台”
运维·nginx·gateway
大G的笔记本2 天前
生产级 Spring Boot 网关完整实现方案
java·笔记·gateway
暗夜猎手-大魔王4 天前
转载--Hermes Agent 13 | Gateway 架构:二十余渠道如何复用同一套 Agent Runtime
人工智能·gateway
YJlio5 天前
OpenClaw 2026.5.2 Beta 更新解读:外部插件安装、ClawHub / npm 切换与 Gateway 性能优化
性能优化·npm·gateway·飞书·多维表格·飞书aily·飞书妙搭
v***59835 天前
SpringCloud实战十三:Gateway之 Spring Cloud Gateway 动态路由
java·spring cloud·gateway
团子的二进制世界5 天前
Gateway :微服务架构的核心网关
微服务·架构·gateway
MrMonkeyHou5 天前
Java微服务架构中的双剑合璧:Nacos与Gateway深度解析
java·微服务·架构·gateway