diff --git a/Dockerfile b/Dockerfile index 1468403..b143b68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,14 @@ ADD steam.conf /etc/nginx/conf.d/ ADD blizzard.conf /etc/nginx/conf.d/ ADD league.conf /etc/nginx/conf.d/ ADD wargaming.conf /etc/nginx/conf.d/ +ADD sony.conf /etc/nginx/conf.d/ +ADD microsoft.conf /etc/nginx/conf.d/ +ADD hirez.conf /etc/nginx/conf.d/ +ADD epic.conf /etc/nginx/conf.d/ RUN mkdir -p /var/lib/nginx/body RUN mkdir -p /var/lib/nginx/fastcgi -RUN mkdir -p /cache/origin +RUN mkdir -p /cache/origin /cache/steam /cache/blizzard /cache/league /cache/wargaming /cache/sony /cache/microsoft /cache/hirez /cache/epic ADD nginx.conf /etc/nginx/nginx.conf diff --git a/README.md b/README.md index e628a14..df585d3 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,34 @@ Wargaming.net: dl.wargaming.net dl2.wargaming.net wg.gcdn.co + +Sony (PS4): +*.dl.playstation.net +*.dl.playstation.net.edgesuite.net +dl.playstation.net +dl.playstation.net.edgesuite.net +pls.patch.station.sony.com; + +Microsoft: +*.download.windowsupdate.com +download.windowsupdate.com +dlassets.xboxlive.com +*.xboxone.loris.llnwd.net +xboxone.vo.llnwd.net +images-eds.xboxlive.com +xbox-mbr.xboxlive.com +assets1.xboxlive.com.nsatc.net +assets1.xboxlive.com + +Hirez: +hirez.http.internapcdn.net + +Epic Games: (not tested, needs custom SSC) +download.epicgames.com +download1.epicgames.com +download2.epicgames.com +download3.epicgames.com +download4.epicgames.com ``` To build and run, do: diff --git a/blizzard.conf b/blizzard.conf index dd55fea..acc9434 100644 --- a/blizzard.conf +++ b/blizzard.conf @@ -1,4 +1,4 @@ -proxy_cache_path /cache/blizzard keys_zone=blizzard:10m levels=1:2 inactive=100d max_size=100g; +proxy_cache_path /cache/blizzard keys_zone=blizzard:10m levels=1:2 inactive=100d max_size=300g; server { listen 80; diff --git a/epic.conf b/epic.conf new file mode 100644 index 0000000..a434f8a --- /dev/null +++ b/epic.conf @@ -0,0 +1,24 @@ +proxy_cache_path /cache/epic keys_zone=epic:10m levels=1:2 inactive=100d max_size=200g; + +server { + listen 80; + server_name download.epicgames.com download1.epicgames.com download2.epicgames.com download3.epicgames.com download4.epicgames.com ; + + sendfile on; + resolver 8.8.8.8 8.8.4.4; + + access_log /var/log/nginx/epic-access.log; + error_log /var/log/nginx/epic-error.log error; + + location / { + slice 1m; + proxy_cache epic; + proxy_cache_key $uri$slice_range; # $is_args$args + proxy_set_header Range $slice_range; + proxy_cache_valid 200 206 3000h; + proxy_pass http://$host; + + proxy_ignore_headers Expires Cache-Control; + + } +} diff --git a/hirez.conf b/hirez.conf new file mode 100644 index 0000000..589e752 --- /dev/null +++ b/hirez.conf @@ -0,0 +1,24 @@ +proxy_cache_path /cache/hirez keys_zone=hirez:10m levels=1:2 inactive=100d max_size=50g; + +server { + listen 80; + server_name hirez.http.internapcdn.net; + + sendfile on; + resolver 8.8.8.8 8.8.4.4; + + access_log /var/log/nginx/hirez-access.log; + error_log /var/log/nginx/hirez-error.log error; + + location / { + slice 1m; + proxy_cache hirez; + proxy_cache_key $uri$slice_range; # $is_args$args + proxy_set_header Range $slice_range; + proxy_cache_valid 200 206 3000h; + proxy_pass http://$host; + + proxy_ignore_headers Expires Cache-Control; + + } +} diff --git a/microsoft.conf b/microsoft.conf new file mode 100644 index 0000000..d8bbab3 --- /dev/null +++ b/microsoft.conf @@ -0,0 +1,24 @@ +proxy_cache_path /cache/microsoft keys_zone=microsoft:10m levels=1:2 inactive=100d max_size=1000g; + +server { + listen 80; + server_name *.download.windowsupdate.com download.windowsupdate.com dlassets.xboxlive.com *.xboxone.loris.llnwd.net xboxone.vo.llnwd.net images-eds.xboxlive.com xbox-mbr.xboxlive.com assets1.xboxlive.com.nsatc.net assets1.xboxlive.com; + + sendfile on; + resolver 8.8.8.8 8.8.4.4; + + access_log /var/log/nginx/microsoft-access.log; + error_log /var/log/nginx/microsoft-error.log error; + + location / { + slice 1m; + proxy_cache microsoft; + proxy_cache_key $uri$slice_range; # $is_args$args + proxy_set_header Range $slice_range; + proxy_cache_valid 200 206 3000h; + proxy_pass http://$host; + + proxy_ignore_headers Expires Cache-Control; + + } +} diff --git a/origin.conf b/origin.conf index 77cc159..546da00 100644 --- a/origin.conf +++ b/origin.conf @@ -2,7 +2,7 @@ proxy_cache_path /cache/origin keys_zone=origin:10m levels=1:2 inactive=100d max server { listen 80; - server_name origin-a.akamaihd.net ; + server_name origin-a.akamaihd.net akamai.cdn.ea.com lvlt.cdn.ea.com ; sendfile on; resolver 8.8.8.8 8.8.4.4; diff --git a/sony.conf b/sony.conf new file mode 100644 index 0000000..56d5b35 --- /dev/null +++ b/sony.conf @@ -0,0 +1,24 @@ +proxy_cache_path /cache/sony keys_zone=sony:10m levels=1:2 inactive=100d max_size=1000g; + +server { + listen 80; + server_name *.dl.playstation.net *.dl.playstation.net.edgesuite.net dl.playstation.net dl.playstation.net.edgesuite.net pls.patch.station.sony.com; + + sendfile on; + resolver 8.8.8.8 8.8.4.4; + + access_log /var/log/nginx/sony-access.log; + error_log /var/log/nginx/sony-error.log error; + + location / { + slice 1m; + proxy_cache sony; + proxy_cache_key $uri$slice_range; # $is_args$args + proxy_set_header Range $slice_range; + proxy_cache_valid 200 206 3000h; + proxy_pass http://$host; + + proxy_ignore_headers Expires Cache-Control; + + } +} diff --git a/steam.conf b/steam.conf index e7529ba..4a4dce4 100644 --- a/steam.conf +++ b/steam.conf @@ -1,11 +1,11 @@ -proxy_cache_path /cache/steam keys_zone=steam:100m levels=1:2 inactive=100d max_size=400g; +proxy_cache_path /cache/steam keys_zone=steam:100m levels=1:2 inactive=100d max_size=1000g; server { listen 80; sendfile on; - server_name ~^(content[0-9]+)\.steampowered\.com$ ~^.*\.cs\.steampowered\.com$ client-download.steampowered.com; + server_name ~^(content[0-9]+)\.steampowered\.com$ ~^.*\.cs\.steampowered\.com$ client-download.steampowered.com *.hsar.steampowered.com.edgesuite.net *.akamai.steamstatic.com content-origin.steampowered.com; resolver 8.8.8.8 8.8.4.4; access_log /var/log/nginx/steam-access.log;