简体   繁体   中英

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

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). 10x

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