stream { upstream backend { server xmpp.example.com:5222; } server { listen 5222; proxy_pass backend:5222; } }