springcloud网关跨域问题和转发服务的配置
2021-02-01 03:14
标签:glob pre oba ring yml strip ons filter 跨域 springcloud网关跨域问题和转发服务的配置 标签:glob pre oba ring yml strip ons filter 跨域 原文地址:https://www.cnblogs.com/shangyunlin/p/12815300.htmlspring:
application:
name: gateway-web
cloud:
gateway:
globalcors:
cors-configurations:
‘[/**]‘: # 匹配所有请求
allowedOrigins: "*" #跨域处理 允许所有的域
allowedMethods: # 支持的方法
- GET
- POST
- PUT
- DELETEspring:
application:
name: gateway-web
cloud:
gateway:
routes:
- id: changgou_goods_route
uri: lb://goods
predicates:
- Path=/api/album/**,/api/brand/**,/api/cache/**
filters:
#- PrefixPath=/brand
- StripPrefix=1
#用户微服务
上一篇:JAVA8新特性
文章标题:springcloud网关跨域问题和转发服务的配置
文章链接:http://soscw.com/index.php/essay/49317.html