访问gateway报出503,直接访问成功,

前端访问地址: // api接口请求地址
window.SITE_CONFIG['baseUrl'] = 'http://localhost:88/api';
网关配置:
spring:
application:

name: gulimall-gateway

cloud:

nacos:
  discovery:
    server-addr: 192.168.43.236:8848
gateway:
  discovery:
    locator:
      enabled: true
      lowerCaseServiceId: true
      filters:
        - StripPrefix=1
  routes:
    - id: admin_route
      uri: lb://renren-fast 
      predicates: 
        - Path=/api/** 
      filters:
        - RewritePath=/api/(?<segment>.*),/renren-fast/$\{segment}  

server:
port: 88

bootstarp.properties配置:
spring.application.name=gulimall-gateway
spring.cloud.nacos.config.server-addr=192.168.43.236:8848
spring.cloud.nacos.discovery.server-addr=192.168.43.236:8848

image.png
image.png
image.png
image.png

码云地址:https://gitee.com/zsf__git/gu...

阅读 1.8k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题