Bind a stream to 443 where you can match on the hostname. Then you can decide on that what it isvpn.example.com -> TCP/1194Default to TCP/8443Then bind the HTTPS port of nginx to 8443 and communicate with the proxy protocol. Then you can pass the source IP address as well.
stream { upstream vpn { server 127.0.0.1:1194; # vpn interface } upstream web { server 172.16.1.1:8443; #interface where nginx http would be binded to } map $ssl_preread_protocol $upstream { default vpn; "TLSv1.2" web; } # VPN and SSL on the same port server { listen 443 proxy_protocol; proxy_pass $upstream; ssl_preread on; proxy_protocol on; }}
port-share 172.16.1.1 443; #nginx http service