Created
August 3, 2022 15:07
-
-
Save WoozyMasta/3fcc9e5f7b6dd31ca211c0bcd5aee846 to your computer and use it in GitHub Desktop.
SSL and SSH on the same port in Nginx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stream { | |
upstream ssh { | |
server 127.0.0.1:22; | |
} | |
upstream web { | |
server 127.0.0.1:443; | |
} | |
map $ssl_preread_protocol $upstream { | |
"" ssh; | |
"TLSv1.2" web; | |
default 127.0.0.1:443; | |
} | |
server { | |
listen 192.168.0.1:443; | |
proxy_pass $upstream; | |
ssl_preread on; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment