server {
listen 80;
listen 443 ssl;
server_name xui.example.com;
ssl_certificate /path/to/letsencrypt/certificate.pem;
ssl_certificate_key /path/to/letsencrypt/private.key;
location / {
proxy_pass http://127.0.0.1:2053;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
stream {
map $ssl_preread_server_name $name {
www.microsoft.com xui-reality;
}
server {
listen 443 ssl;
proxy_pass $name;
}
upstream xui-reality {
server 127.0.0.1:443; # Replace with the actual backend server IP and port
}
}