【发布时间】:2021-01-24 08:03:14
【问题描述】:
我们正在使用 Auth0 集成来为我们的 Spring Boot 应用程序提供身份验证。 在 google cloud run 中使用 docker 部署了一个应用程序。
但是当我尝试交换令牌时,我收到来自 auth0 的错误“预期 https://.. 但转到 http://。”
发生这种情况的原因是 httpServletReuqest.getRequestURI() 返回 http 而不是 https。
问题是为什么我们的网站在云运行中部署为https时getRequestURI返回http? 我还记录了 nginx 标头和 X-Forwarded-Proto = https。
【问题讨论】:
-
我认为这是由于负载平衡器terminating TLS 在请求到达您的应用程序之前发生的。
-
但是有没有办法让它不终止 TLS?
-
还没有。 Cloud Run 部署在负责 TLS 通信的 GFE(Google 前端)后面。
标签: spring-boot servlets google-cloud-platform google-cloud-run