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

操作截图:

相关推荐
JJJennie7772 天前
MAI Gateway私有化部署全攻略:大模型网关接入DeepSeek?附架构图
大模型·gateway·ai网关·魔芋ai
JJJennie7775 天前
MAI Gateway私有化部署全攻略:大模型网关如何接入?附架构图
算法·gateway·ai网关·魔芋ai
Raas1005 天前
MAI Gateway实战部署:AI网关私有化部署?从0到1上手指南
人工智能·gateway·mai gateway·企业级ai产品
Raas1005 天前
AI网关如何接入?MAI Gateway部署实操教程
java·开发语言·人工智能·gateway·ai网关·mai gateway·企业级产品
Raas1008 天前
AI网关部署方案?从部署到上线全流程
java·开发语言·人工智能·gateway·ai网关·企业级ai网关·企业级ai产品
Raas1009 天前
AI网关怎么部署?MAI Gateway部署实操教程
人工智能·开源·gateway·mai gateway·企业级ai产品
Raas10010 天前
MAI Gateway实战部署:AI网关怎么部署?从0到1上手指南
人工智能·gateway·ai网关·企业级ai网关·企业级产品·ai技术交流
4SAPI11 天前
会议智能处理大模型 API 生产选型指南:4SAPI、硅基流动与 OpenRouter 的架构权衡
人工智能·架构·自动化·gateway·php
JJJennie77711 天前
MAI Gateway实战部署:大模型网关部署方案?从0到1上手指南
数据库·人工智能·gateway·ai网关