关于使用GATEWAY后静态资源失效问题

关于使用GATEWAY后静态资源失效问题
参考:https://www.freesion.com/article/5956453278/

第一种方式:你直接将静态文件都放到gateway的工程目录下

第二种方式(推荐):配置文件方式

贴出主要配置:/static/**表示对静态资源的路由

routes:
        - id: home-service
          uri: lb://home-service #lb表示从注册中心找到服务
          predicates: #路由规则
            - Path=/home-service/**, /static/**
        - id: user-service
          uri: lb://user-service
          predicates:
            - Path=/user-service/**, /static/**


posted @ 2021-03-08 14:33  sgyjzmh  阅读(1496)  评论(0编辑  收藏  举报