简体   繁体   中英

How to use Spring Cloud Netflix Zuul as SSL reverse proxy

I've setup a simple Spring Boot application with Spring Cloud Zuul via @EnableZuulProxy annotation as reverse Proxy for some other backend applications deployed as separate microservices.

The zuul reverse proxy is acting as an API gateway in front of the various backend services.

Since this API gateway is the only external reachable destination, it also acts as single secured entry point via HTTPS. The proxied backend services are not secured separately, so they just using plain HTTP.

In the past I was using Nginx for this setup and I am now evaluating Spring Cloud Netflix Zuul as an replacement with Eureka service discovery but it seems that Zuul is not adding the required X-Forwarded-Proto: https HTTP header.

How can I tell zuul to act as SSL proxy for non-secured HTTP backend services?

Just figured out that spring-cloud-netflix is adding the X-Forwarded-* HTTP headers and therefore responsible for them.

Filed a PR for adding the X-Forwarded-Proto header to their org.springframework.cloud.netflix.zuul.filters.pre.PreDecorationFilter at https://github.com/spring-cloud/spring-cloud-netflix/pull/515

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM