server { listen 80 http2 proxy_protocol; set_real_ip_from 127.0.0.1; real_ip_header proxy_protocol; server_name v2raydomain.xxx; index xxxx; root /love/v2ray; } server { listen 127.0.0.1:8443 ssl http2 proxy_protocol; set_real_ip_from 127.0.0.1; real_ip_header proxy_protocol; server_name domain.xxx; index xxxx; root /domain; } server { listen 127.0.0.1:8443 ssl http2 proxy_protocol; set_real_ip_from 127.0.0.1; real_ip_header proxy_protocol; server_name domain2.xxx; index xxxx; root /domain2; } stream { map $ssl_preread_server_name $backend_name { v2raydomain.xxx v2ray; default web; } upstream v2ray { server 127.0.0.1:8080; } upstream web { server 127.0.0.1:8443; } server { listen 443 reuseport; listen [::]:443 reuseport; proxy_pass $backend_name; proxy_protocol on; ssl_preread on; }