Gateway反向代理配置

前言

一般而言,反向代理都是在Nginx中来实现的,其实Gateway也可以作为反向代理服务,不过一般不会这么做,只不过最近的项目,在通过Nginx反向代理之后,iPhone手机访问接口代理地址会异常,安卓手机并不会,奈何技术水平欠缺,数天尝试解决无果后只能退而求其次,通过Gateway来作为网关与代理服务。

配置方式

编辑application.yml文件
yaml 复制代码
# 找到spring.cloud.gateway.routes配置,新增如下配置:
spring:
  cloud:
    gateway:
      routes: #路由配置
        # id,必须唯一
        - id: api
        # 反向代理的服务器地址
        uri: http://localhost:8080/api
        # 匹配规则
        predicates:
          - Path=/api/**
相关推荐
码点滴3 小时前
私有 Gateway 接入企业 IM:从消息路由到多租户隔离——Hermes Agent 工程实战
人工智能·架构·gateway·prompt·智能体·hermes
代码写到35岁5 小时前
Gateway+OpenFeign 踩坑总结
gateway
invicinble5 小时前
对于gateway信息量沉淀
gateway
郝开1 天前
Spring Cloud Gateway 3.5.14 使用手册
java·数据库·spring boot·gateway
Ribou2 天前
Kubernetes v1.35.2 基于 Cilium Gateway API 的服务访问架构
架构·kubernetes·gateway
huipeng9263 天前
GateWay使用详解
java·spring boot·spring cloud·微服务·gateway
随风,奔跑7 天前
Spring Cloud Alibaba(四)---Spring Cloud Gateway
后端·spring·gateway
jiayong237 天前
Hermes Agent 的 Skills、Plugins、Gateway 深度解析
ai·gateway·agent·hermes agent·hermes
鬼蛟7 天前
Gateway
gateway
武超杰7 天前
Spring Cloud Gateway 从入门到实战
spring cloud·gateway