map $ssl_preread_server_name $name { yourdomain.com tornado_mainnet; default tornado_mainnet; } upstream tornado_mainnet { server 127.0.0.1:4380; } server { listen 0.0.0.0:443; proxy_pass $name; ssl_preread on; }