upstream api { server 127.0.0.1:9090; } upstream react { server 127.0.0.1:3000; } server { listen 80 default_server; server_name cmdui.local; charset utf-8; location ~ ^/api/ { # Disable buffering to allow streaming logs in real-time proxy_buffering off; proxy_pass http://api; } # React websockets connection location ~ ^/sockjs-node/ { proxy_pass http://react; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; } location ~ / { proxy_pass http://react; } }