微服务SpringCloud关于使用GATEWAY后静态资源失效问题

2022-07-07 12:05:54

我们都知道,既然gateway作为网关用来路由转发的话,静态资源自然也是可以通过网关转发自内网获取静态资源
/static/**是静态资源的路由


  routes:
    - id: oauth2-api-route
      uri: lb://micro-oauth2-api
      predicates:
        - Path=/api/**,/static/**

记得也要加上/static/

<script th:src="@{/static/js/app.js}"></script>
  • 作者:@燕子-
  • 原文链接:https://blog.csdn.net/qq_41948525/article/details/117435997
    更新时间:2022-07-07 12:05:54