events {} http { map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 7000; location /agent_0/ { proxy_pass http://agent-0:8000/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } location /agent_1/ { proxy_pass http://agent-1:8000/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } } }