server { listen 80; root /var/www; location / { try_files $uri /index.html; } } server { server_name api.*; location / { proxy_pass http://api:8080/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } }