Gateway 配置参数理解

复制代码
spring:
  cloud:
    gateway:
      routes:
        - id: gateway1
          uri: lb://gateway-test
          predicates:
            - Path=/ershiqijian/**
          filters:
            - StripPrefix=1

id:唯一标识符

这里的

复制代码
predicates:
   - Path=/ershiqijian/**

意味着当例如请求http://ershiqijian/\*\*,也就是请求路径前带上ershiqijian后,gateway会把请求转发到注册到nacos上的gateway-test这个模块

这里的

复制代码
 filters:
    - StripPrefix=1

意味着原先可能需要请求:ershiqijian/server/getall

而现在可以跳过一个前缀,直径请求 ershiqijian/getall 即可

相关推荐
接着奏乐接着舞17 小时前
gateway
gateway
一个public的class2 天前
前后端 + Nginx + Gateway + K8s 全链路架构图解
前端·后端·nginx·kubernetes·gateway
uNke DEPH3 天前
SpringCloud Gateway 集成 Sentinel 详解 及实现动态监听Nacos规则配置实时更新流控规则
spring cloud·gateway·sentinel
ERBU DISH3 天前
当遇到 502 错误(Bad Gateway)怎么办
gateway
小超同学你好7 天前
OpenClaw 深度解析与源代码导读 · 第3篇:Gateway——常驻控制面、单端口多协议与进程骨架
人工智能·深度学习·语言模型·gateway
w6100104668 天前
Cka-2026-gateway解释
gateway·k8s·cka
岳来9 天前
网络小白docker network create时如何指定subnet 和gateway
网络·docker·gateway·subnet
如来神掌十八式10 天前
nginx + spring gateway+spring 服务_nginx 转发到 gateway
nginx·spring·gateway
晏宁科技YaningAI10 天前
分布式通信系统的容错机制
网络协议·微服务·系统架构·gateway·信息与通信·paas
爱淋雨的男人12 天前
网关gateway详解
gateway