/etc/nginx/sites-available/default settingsEdit
General ServerEdit
server {
limit_conn addr 20;
limit_req zone=perip burst=40 nodelay;
limit_req zone=perbot burst=8;
limit_req_status 429;
location / {
proxy_buffering on;
proxy_buffers 8 16k;
}
}
Mediawiki ServerEdit
server {
limit_conn addr 25;
limit_req zone=perbot burst=5;
limit_req_status 429;
location / {
proxy_request_buffering off;
proxy_buffering on;
limit_req zone=perapi burst=80 nodelay;
}
}
Tile Server / Peertube-like ServerEdit
server {
limit_conn addr 60; # Tiles / media need higher connection caps and higher rate; we use highthroughput
limit_req zone=highthroughput burst=200 nodelay;
limit_req zone=perip burst=40 nodelay; # still apply basic perip for other endpoints
limit_req_status 429;
location / {
limit_req zone=highthroughput burst=400 nodelay; # give very high throughput for tiles
proxy_cache tile_cache; # strongly recommended: cache tiles in nginx
proxy_cache_valid 200 1h;
proxy_buffering on;
expires max;
add_header Cache-Control "public, max-age=31536000, immutable";
}
}