Access Proxmox containers via Nginx proxy_pass

0rx

New Member
May 20, 2018
1
0
1
38
Hello,
I have three Proxmox containers, one of them is nginx to act as redirection to other two containers. http redirection to both containers works fine. I'm stuck with https (openssl). The nginx conf I've tried so far

Code:
server {
        listen 443 ssl;
        server_name example.ddns. net;
        access_log /var/log/nginx/example_access.log;
        error_log /var/log/nginx/example_error.log;

        ssl on;
        ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
        ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
        proxy_redirect off;

        location / {
            proxy_pass https: //192.168.178.100;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
        }
}

This shows 502 bad gateway when accessing through https: //example.ddns.net. On 192.168.178.100 is apache2 running with http configured and port 8080 is listening.

The error from nginx error log
Code:
2018/05/20 19:04:48 [error] 882#882: *1 SSL_do_handshake() failed (SSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol) while SSL handshaking to upstream, client: [public_ip_here], server: example.ddns. net, request: "GET / HTTP/1.1", upstream: "https: //192.168.178.100:443/", host: "example.ddns. net"
I don't get what I'm missing. Thanks for any help.
 
although this has nothing to do with proxmox
i guess your problem is this line:
proxy_pass https: //192.168.178.100;
you say nginx that the upstream server listens on 192.168.178.100:443 with ssl which i guess is not the case