server { listen 8001 default_server; server_name web1.example.com; location / { proxy_pass https://doh.hnshosting.au; proxy_set_header Host doh.hnshosting.au; } } server { listen 8002 default_server; server_name web2.example.com; location / { proxy_pass https://easyhandshake.com:8053; proxy_set_header Host easyhandshake.com; } } server { listen 8003 default_server; server_name web3.example.com; location / { proxy_pass https://doh.hnsdns.com; proxy_set_header Host doh.hnsdns.com; } } upstream main { server 127.0.0.1:8001; server 127.0.0.1:8002; server 127.0.0.1:8003; } server { listen 80; server_name _; location / { proxy_pass http://main; } }