spring-cloud / spring-cloud-netflix

Integration with Netflix OSS components
http://cloud.spring.io/spring-cloud-netflix/
Apache License 2.0
4.87k stars 2.44k forks source link

Zuul ssl config with http routes #2234

Closed jayhamilton closed 7 years ago

jayhamilton commented 7 years ago

I have a Zuul configuration as below. The port 8001 is setup to be https. The appa-service and appb-service as well as Spring Boot/Zuul are running on the same server but without Eureka. I have added SimpleFilter which extends ZuulFilter. I also have an angular GUI being served from 8001 via the static folder of the Spring Boot/Zuul configuration. No Eureka and no Ribbon. The base urls established within the angular gui includes https://machine ip/8001/appa/ and https://machine ip/8001/appb/

Just wondering if this is a valid configuration?

spring: application: name: zuul server: port: 8001 ssl: enabled: true key-store: classpath:keystore.jks key-store-password: *** key-alias: selfsigned keyStoreType: JKS zuul: routes: appa-service: url: http://localhost:8082 path: /appa/ appb-service: url: http://localhost:8083 path: /appb/** sensitiveHeaders: Cookie,Set-Cookie addProxyHeaders: false

ryanjbaxter commented 7 years ago

I am unsure what the issue is, can you elaborate?

jayhamilton commented 7 years ago

Hi Ryan, After I created this question I solved one of the problems that prompted this. We had a bug in the GUI's request to the Zuul proxy. Zuul was setup for ssl but the request from the GUI was non ssl. So that issue is solved.

I am now facing a problem with HATEOAS links coming from one of the services whith Zuul configured for ssl. The request coming into ZUUL is now HTTPS based but the service's HATEOAS links are returning HTTP and thus causes a Mixed Content error within the browser. I found some reference to using a post filter to rewrite the HATEOAS links within the context.getResponseBody() or context.getResponseDataStream(). So far I have had no luck accessing the json response from either of these operations.

My current issue may have something to do with the fact that responses from the server have an encoding: gzip, deflate, br

jayhamilton commented 7 years ago

We have moved further in getting access to the response body within a post filter. It turned out that there was a pre filter impacting our ability to get access to the post filter information. With the pre-filter removed we are now able to access the post filter's response body after unzipping the content.

ryanjbaxter commented 7 years ago

So can we close this?

jayhamilton commented 7 years ago

Yes, please close this.

Sent from my iPhone

On Aug 31, 2017, at 4:56 PM, Ryan Baxter notifications@github.com<mailto:notifications@github.com> wrote:

So can we close this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/spring-cloud/spring-cloud-netflix/issues/2234#issuecomment-326418460, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABHCUWfGdgrya16xp4Xzx0Gflxny3iUOks5sdx4TgaJpZM4PFPRZ.