Automatically cache game files and updates at LAN parties using Nginx as a reverse proxy running bare metal without Docker containerization.
Credit to the lancache.net team for all their work on content caching for LANs.
- Ubuntu Server 24.04
- A DNS server to redirect clients to the cache:
apt install nginx
mv /etc/nginx /etc/nginx.defaultgit clone git@github.com:zeorpingheroes/lancache-bare-metal.git /etc/nginx
mkdir -p /srv/lancache/data /srv/lancache/logs/http /srv/lancache/logs/streamchown -R www-data:www-data /srv/lancache
To use a different directory, find and replace in the config files:
find /etc/nginx -type f -name "*.conf" -print0 | xargs -0 sed -i'' -e 's|/srv/lancache|/your/path|g'
sed -i -e 's/max_size=3000g/max_size=1000g/g' /etc/nginx.conf
nginx -t
systemctl start nginx