user nginx; worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; events { worker_connections 1024; } stream { map $ssl_preread_server_name $backend { support.microsoft.com reality; fixit.support.microsoft.com reality; help.groupme.com reality; Support-uat.microsoft.com reality; www.support.microsoft.com reality; default nginx; } upstream reality { server xray:443; } upstream nginx { server nginx:443; } server { listen 443 reuseport; listen [::]:443 reuseport; proxy_pass $backend; ssl_preread on; # proxy_protocol on; } } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; }