简体   繁体   English

Nginx proxy_pass 警报握手失败:SSL

[英]Nginx proxy_pass alert handshake failure:SSL

i have an nginx server behind a GKE ingress as a backend to serve static content (angular).我在 GKE 入口后面有一个 nginx 服务器作为后端来提供静态内容(角度)。

i was trying to make a route on the nginx itself to route traffic to another external service (cloud function).我试图在 nginx 本身上建立一条路由,以将流量路由到另一个外部服务(云功能)。

when doing it with redirects like the following:使用以下重定向执行此操作时:

server {
    listen 8080;
    server_name main-app.example.com

    location /service {
      return 307 https://cloud-function-url.example.com$request_uri;
    }
}

it basically works, and my angular app redirect the request of /service to the cloud function url and assuming i have cors enabled on this cloud function all works.它基本上可以工作,并且我的 angular 应用程序将 /service 的请求重定向到云函数 url 并假设我在此云函数上启用了 cors 一切正常。

i wanted to do the same while proxying the request instead of redirecting it, to eliminate the cors hook.我想在代理请求而不是重定向请求时做同样的事情,以消除 cors 钩子。 so i've tried to update the location directive to :所以我试图将位置指令更新为:

location /service {
  proxy_pass  http://cloud-function-url.example.com;
}

this fails on SSL issue with the error这在 SSL 问题上失败并出现错误

routines:ssl3_read_bytes:sslv3 alert handshake failure:SSL alert number 40) while SSL handshaking to upstream

i've tried many suggestion regarding setting specific headers without luck.我已经尝试了很多关于设置特定标题但没有运气的建议。 i feel i'm missing something basic.我觉得我缺少一些基本的东西。 any help will be appriciated.任何帮助都会得到帮助。

10x 10倍

I've solved it by setting the route to a different public url which is the cloud run url instead of the cloud dns (custom domain).我通过将路由设置为不同的公共 url 来解决它,该公共 url 是云运行 url 而不是云 dns(自定义域)。 10x 10倍

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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