I try to proxy requests with nginx to a GlooEdge API Gateway, but it keeps failing with a 502 error code and a message:
peer closed connection in SSL handshake while SSL handshaking to upstream, client: 172.24.0.1, server: myapp.mydomain.fr, request: "GET /api/selfcare/refunds HTTP/2.0", upstream: "https://XX.XXX.XX.XXX:443/selfcare/refunds", host: "myapp.mydomain.fr:20889"
Here is my nginx config:
upstream my_api {
server myapi.mydomain.fr:443;
}
server {
listen 80;
return 301 https://$host:20443$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name myapp.mydomain.fr;
ssl_certificate /etc/ssl/certs/nginx/myapp.mydomain.fr.pem;
ssl_certificate_key /etc/ssl/certs/nginx/myapp.mydomain.fr.key;
location /api/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_pass https://my_api/;
}
location / {
proxy_pass http://my_app;
}
}
I think i tried everything, i digged every website and documentation, but i'm still unable to make this work ...
Does anyone have an idea ?