server { listen 80; server_name localhost; proxy_http_version 1.1; location / { proxy_pass ${FRONT_PROXY_PASS}; } location /socket/v2 { proxy_pass http://backend:4000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } location /api/ { proxy_pass http://backend:4000/api; } } server { listen 81; server_name localhost; proxy_http_version 1.1; proxy_hide_header Access-Control-Allow-Origin; proxy_hide_header Access-Control-Allow-Methods; add_header 'Access-Control-Allow-Origin' 'http://localhost' always; add_header 'Access-Control-Allow-Methods' 'PUT, GET, POST, OPTIONS, DELETE, PATCH' always; location / { proxy_pass http://backend:4000; } location /socket { proxy_pass http://backend:4000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } } server { listen 82; server_name localhost; proxy_http_version 1.1; proxy_hide_header Access-Control-Allow-Origin; proxy_hide_header Access-Control-Allow-Methods; add_header 'Access-Control-Allow-Origin' 'http://localhost' always; add_header 'Access-Control-Allow-Credentials' 'true' always; add_header 'Access-Control-Allow-Methods' 'PUT, GET, POST, OPTIONS, DELETE, PATCH' always; location / { proxy_pass http://stats:8050; } location /socket/v2 { proxy_pass http://backend:4000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; } }