# Front door on the Space's port. WebSocket upgrades are game players (Captain of Sea server on # 27777), /cos2/ is the game's error reports (8001); every other request is the Kimi proxy (uvicorn # on 8000), exactly as before. worker_processes 1; pid /tmp/nginx.pid; error_log /dev/stderr warn; events { worker_connections 1024; } http { access_log off; client_body_temp_path /tmp/nginx_body; proxy_temp_path /tmp/nginx_proxy; fastcgi_temp_path /tmp/nginx_fastcgi; uwsgi_temp_path /tmp/nginx_uwsgi; scgi_temp_path /tmp/nginx_scgi; map $http_upgrade $backend { default http://127.0.0.1:8000; ~*^websocket$ http://127.0.0.1:27777; } map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 7860; client_max_body_size 50m; # The game's error reports (reports.py). location /cos2/ { proxy_pass http://127.0.0.1:8001; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $http_x_forwarded_for; } location / { proxy_pass $backend; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $host; # Long chats stream (SSE) and sailors stay for hours: no buffering, long timeouts. proxy_buffering off; proxy_read_timeout 3600s; proxy_send_timeout 3600s; } } }