Files
trunk-server/nginx-proxy/nginx.conf
Luke Berndt 5b177eca58 Raise nginx connection limits and microcache /calls polling
A traffic surge exhausted nginx's 3 x 4096 worker_connections (each
proxied websocket uses two), so Cloudflare got empty responses (520)
and the backend's listen queue filled.

- worker_processes auto (8 cores), worker_connections 16384,
  worker_rlimit_nofile 65535.
- Cache public /calls endpoints on api.*: 5s for live lists, 60s for
  historical ones, with cache lock and stale-while-updating so bursts
  collapse to one backend query. Origin is in the cache key because
  the backend's CORS header varies by Origin.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 22:42:11 -05:00

42 lines
883 B
Nginx Configuration File

user www-data;
worker_processes auto;
worker_rlimit_nofile 65535;
pid /var/run/nginx.pid;
events {
worker_connections 16384;
}
error_log /dev/stdout error;
http {
log_format main '$http_host '
'$remote_addr '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" ';
#access_log /dev/stdout main;
#access_log off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript
text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
}