首页 > 解决方案 > Nginx proxy_pass alert handshake failure:SSL

问题描述

i have an nginx server behind a GKE ingress as a backend to serve static content (angular).

i was trying to make a route on the nginx itself to route traffic to another external service (cloud function).

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.

i wanted to do the same while proxying the request instead of redirecting it, to eliminate the cors hook. 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

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

标签: nginxproxycloud

解决方案


我通过将路由设置为不同的公共 url 解决了这个问题,该公共 url 是云运行 url 而不是云 dns(自定义域)。10倍


推荐阅读