首页 > 解决方案 > Spring Cloud Gateway 和 Oauth2 Server 响应异常 url

问题描述

网关配置:bootstrap.yml

spring:
  application:
    name: tools-gateway
  cloud:
    nacos:
      config:
        server-addr: tools-nacos:9999
        group: DEFAULT_GROUP
        prefix: tools-gateway
        file-extension: yaml
      discovery:
        server-addr: tools-nacos:9999
    gateway:
      routes:
        - id: tools-uaa
#          uri: lb://tools-uaa
          uri: http://tools-nacos:8001
          predicates:
            - Path=/auth/**
          filters:
            - StripPrefix=1
  profiles:
    active: dev

端口 8443

访问网址:http://localhost:8443/auth/username 响应网址: 在此处输入图像描述

访问网址:http://localhost:8001/auth/username

是成功

标签: javaspringspring-bootspring-cloud

解决方案


推荐阅读