0% found this document useful (0 votes)
73 views

Game Caching System - Odt

This document contains the configuration for an Nginx server that will cache Steam downloads locally. It defines four different log formats to differentiate local, remote, default, and other requests. It configures Nginx to listen on port 80, sets the document root and error pages, enables caching, and uses a reverse proxy to pass requests to the origin server with headers to indicate the cache status and timing. Requests for depot downloads are logged locally, while other requests are logged as remote or other.

Uploaded by

Lincoln Wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Game Caching System - Odt

This document contains the configuration for an Nginx server that will cache Steam downloads locally. It defines four different log formats to differentiate local, remote, default, and other requests. It configures Nginx to listen on port 80, sets the document root and error pages, enables caching, and uses a reverse proxy to pass requests to the origin server with headers to indicate the cache status and timing. Requests for depot downloads are logged locally, while other requests are logged as remote or other.

Uploaded by

Lincoln Wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#

# This minimal configuration is part of the steam cache docker image.


#
log_format steamcache-default '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer"
"$http_user_agent" DEFAULT';
log_format steamcache-other '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer"
"$http_user_agent" OTHER';
log_format steamcache-local '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer"
"$http_user_agent" LOCAL';
log_format steamcache-remote '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer"
"$http_user_agent" REMOTE';
server {
listen 80;
access_log /data/logs/access.log steamcache-default;
error_log /data/logs/error.log;
root /data/cache/;
index index.html index.htm;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
proxy_temp_path /tmp/nginx/ 1 2;
## Uncomment this line to proxy through lancache.net.
## This allows us to keep the online cache up-to-date for events
## to rsync down to their own caches.
## As a bonus, this also allows you to configure a single route to
## direct your Steam download traffic down an alternative network
## interface (e.g. 3G modem, second DSL line) from your primary
## internet connection.
resolver 8.8.8.8;
location /depot/ {
try_files $uri @mirror;
access_log /data/logs/access.log steamcache-local;
}
location / {
proxy_next_upstream error timeout http_404;
proxy_pass http://$host$request_uri;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Mirror-Upstream-Status $upstream_status;
add_header X-Mirror-Upstream-Response-Time $upstream_response_time;
add_header X-Mirror-Status $upstream_cache_status;
add_header Host $host;
access_log /data/logs/access.log steamcache-other;
}
location @mirror {
proxy_store on;
proxy_store_access user:rw group:rw all:r;
proxy_next_upstream error timeout http_404;
proxy_pass http://$host$request_uri;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header X-Mirror-Upstream-Status $upstream_status;
add_header X-Mirror-Upstream-Response-Time $upstream_response_time;
add_header X-Mirror-Status $upstream_cache_status;
access_log /data/logs/access.log steamcache-remote;
}
}

Reference:
https://arstechnica.com/gaming/2017/01/building-a-local-steam-caching-server-to-ease-the-
bandwidth-blues/
https://pathar.tl/blog/steam-cache/

blizzard:
https://github.com/lancachenet/lancache-dns/pull/29/files
https://cdn.jsdelivr.net/npm/[email protected]/README.md
Important article for nginx caching system: https://www.nginx.com/blog/nginx-high-performance-
caching/

Lancache tutorial: https://github.com/zeropingheroes/lancache


https://github.com/zeropingheroes/lancache-installer
https://community.ui.com/questions/Lan-Caching/11c0284e-47ba-4222-9410-691c97dfb0f7
https://linustechtips.com/main/topic/962655-steam-caching-tutorial/

You might also like