deploy(nginx): serve the mod jar from nginx with a speed cap (750k per connection) and 2 connections per IP
Some checks are pending
CI / mod (gradle test + checkFolderLimit) (push) Waiting to run
CI / frontend (lint + test + build) (push) Waiting to run
CI / backend (cargo test + clippy) (push) Successful in 7m0s

This commit is contained in:
loki5512344 2026-10-09 22:26:27 +02:00
parent acb69472c2
commit 4a722259a5
Signed by: boba
GPG key ID: 253067914055423B
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,2 @@
# Per-client-IP connection counter for the capped jar download (see the site conf).
limit_conn_zone $binary_remote_addr zone=lv_downloads:10m;

View file

@ -18,6 +18,23 @@ server {
add_header Cache-Control "public, max-age=60" always;
}
# The mod jar is served by nginx itself (not through the gateway) so the
# speed can be capped: ~6 Mbit/s per connection and at most 2 connections
# per client IP keep a flood of downloads from saturating the link.
location = /api/downloads/lovisual.jar {
alias /opt/lovisual/backend/downloads/lovisual.jar;
default_type application/java-archive;
add_header Content-Disposition 'attachment; filename="lovisual.jar"' always;
limit_rate 750k;
limit_conn lv_downloads 2;
limit_conn_status 429;
}
location = /api/downloads/lovisual.jar.sha256 {
alias /opt/lovisual/backend/downloads/lovisual.jar.sha256;
default_type text/plain;
}
location /api/ {
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;