upstream api_upstream { keepalive 30; server backend:3001; } server { listen 80; server_name _; root /usr/share/nginx/html; location / { try_files $uri @index; } location @index { add_header Cache-Control no-cache; expires 0; try_files /index.html =404; index index.html index.htm; } location /socket.io { proxy_pass http://api_upstream; } }