< Nginx
stream{
upstream ssh {
server 127.0.0.1:22;
}
upstream web {
server 127.0.0.1:80;
}
map $ssl_server_name $srv_name {
~(.+)\.ssh ssh;
default web;
}
server {
listen port ssl;
proxy_pass $srv_name;
ssl_preread on;
ssl_certificate /etc/letsencrypt/live/ossmedia.cn/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ossmedia.cn/privkey.pem; # managed by Certbot
}
}