I'm getting a "502 Bad Gateway" error after configuring a public proxy to a private web app running on localhost.
The nginx error log shows:
2024/08/15 13:56:18 [error] 17674#17674: *3 SSL_do_handshake() failed (SSL: error:0A000438:SSL routines::tlsv1 alert internal error:SSL alert number 80) while SSL handshaking to upstream, client: 192.168.19.113, server: testserver.home.private, request: "GET / HTTP/1.1", upstream: "https://127.0.0.1:8081/", host: "testserver.home.private"
The problem is the upstream directive from the nginx config is this:proxy_pass https://app.internal:8081;
The app in question requires access by hostname and not ip address. manually navigating to https://app.internal:8081 from a terminal works fine while using the ip address fails.
The /etc/hosts file on the server maps app.internal to 127.0.0.1 correctly.
I'm concerned that if nginx is doing the resolving itself and getting an ip address that the proxy call will never work. Is there a way to turn off nginx dns queries so that the nginx proxy queries a domain name and not an ip address?