【Zuul】使用学习

【Zuul】使用学习

添加依赖

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>

启用zuul

@EnableZuulProxy

忽略自动生成的路由

zuul:
  ignoredServices: '*'

敏感头 Cookies and Sensitive Headers

敏感头是一个黑名单,默认值不为空,因此想让zuul发送所有的头信息(除了忽略的那些),你必须将其显式的设置为空列表,下面展示了如何使用sensitiveHeaders

zuul:
 routes:
   users:
     path: /myusers/**
     sensitiveHeaders: Cookie,Set-Cookie,Authorization
     url: https://downstream

覆盖全局敏感头设置

zuul
  sensitive-headers: 

 

忽略头 Ignored Headers

posted @ 2019-08-22 18:08  翠微  阅读(184)  评论(0编辑  收藏  举报