From 425a75c7da1de29706692240d9a5ebcfa3215821 Mon Sep 17 00:00:00 2001 From: James Kinsman Date: Sat, 9 Oct 2021 00:11:15 +0100 Subject: [PATCH] Apply suggestions from code review Thanks @gotenxiao Co-authored-by: GotenXiao --- Dockerfile | 4 ++-- overlay/etc/nginx/sites-available/10_cache.conf | 2 -- .../nginx/sites-available/cache.conf.d/10_root.conf | 1 - .../nginx/sites-available/cache.conf.d/20_lol.conf | 1 - .../cache.conf.d/21_arenanet_manifest.conf | 6 +++--- .../sites-available/cache.conf.d/22_wsus_cabs.conf | 8 ++++---- .../cache.conf.d/23_steam_server_status.conf | 8 ++++---- .../cache.conf.d/root/10_loop_detection.conf | 12 ++++++------ overlay/etc/nginx/stream-available/10_sni.conf | 2 +- 9 files changed, 20 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index fe40d75..be99eee 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM lancachenet/ubuntu-nginx:latest LABEL version=3 -LABEL description="Single caching container for caching game content at lan parties." -LABEL maintainer=" LanCache.Net Team " +LABEL description="Single caching container for caching game content at LAN parties." +LABEL maintainer="LanCache.Net Team " ENV GENERICCACHE_VERSION=2 \ CACHE_MODE=monolithic \ diff --git a/overlay/etc/nginx/sites-available/10_cache.conf b/overlay/etc/nginx/sites-available/10_cache.conf index 1976708..950f346 100644 --- a/overlay/etc/nginx/sites-available/10_cache.conf +++ b/overlay/etc/nginx/sites-available/10_cache.conf @@ -1,10 +1,8 @@ - server { listen 80 reuseport; access_log /data/logs/access.log cachelog; error_log /data/logs/error.log; - include /etc/nginx/sites-available/cache.conf.d/*.conf; } diff --git a/overlay/etc/nginx/sites-available/cache.conf.d/10_root.conf b/overlay/etc/nginx/sites-available/cache.conf.d/10_root.conf index b99288e..f065502 100644 --- a/overlay/etc/nginx/sites-available/cache.conf.d/10_root.conf +++ b/overlay/etc/nginx/sites-available/cache.conf.d/10_root.conf @@ -5,4 +5,3 @@ include /etc/nginx/sites-available/cache.conf.d/root/*.conf; } - diff --git a/overlay/etc/nginx/sites-available/cache.conf.d/20_lol.conf b/overlay/etc/nginx/sites-available/cache.conf.d/20_lol.conf index ac58b17..5f1e6ed 100644 --- a/overlay/etc/nginx/sites-available/cache.conf.d/20_lol.conf +++ b/overlay/etc/nginx/sites-available/cache.conf.d/20_lol.conf @@ -1,4 +1,3 @@ - # Fix for League of Legends Updater location ~ ^.+(releaselisting_.*|.version$) { proxy_pass http://$host; diff --git a/overlay/etc/nginx/sites-available/cache.conf.d/21_arenanet_manifest.conf b/overlay/etc/nginx/sites-available/cache.conf.d/21_arenanet_manifest.conf index 509d614..0169230 100644 --- a/overlay/etc/nginx/sites-available/cache.conf.d/21_arenanet_manifest.conf +++ b/overlay/etc/nginx/sites-available/cache.conf.d/21_arenanet_manifest.conf @@ -1,6 +1,6 @@ # Fix for GW2 manifest location ^~ /latest64 { - proxy_cache_bypass 1; - proxy_no_cache 1; - proxy_pass http://$host$request_uri; + proxy_cache_bypass 1; + proxy_no_cache 1; + proxy_pass http://$host$request_uri; } diff --git a/overlay/etc/nginx/sites-available/cache.conf.d/22_wsus_cabs.conf b/overlay/etc/nginx/sites-available/cache.conf.d/22_wsus_cabs.conf index 4af9591..9fe085d 100644 --- a/overlay/etc/nginx/sites-available/cache.conf.d/22_wsus_cabs.conf +++ b/overlay/etc/nginx/sites-available/cache.conf.d/22_wsus_cabs.conf @@ -1,6 +1,6 @@ - # Fix for WSUS authroot cab files + # Fix for WSUS authroot cab files location ~* (authrootstl.cab|pinrulesstl.cab|disallowedcertstl.cab)$ { - proxy_cache_bypass 1; - proxy_no_cache 1; - proxy_pass http://$host$request_uri; + proxy_cache_bypass 1; + proxy_no_cache 1; + proxy_pass http://$host$request_uri; } diff --git a/overlay/etc/nginx/sites-available/cache.conf.d/23_steam_server_status.conf b/overlay/etc/nginx/sites-available/cache.conf.d/23_steam_server_status.conf index 8ed00d3..6f4f8df 100644 --- a/overlay/etc/nginx/sites-available/cache.conf.d/23_steam_server_status.conf +++ b/overlay/etc/nginx/sites-available/cache.conf.d/23_steam_server_status.conf @@ -1,4 +1,4 @@ -location = /server-status { - proxy_no_cache 1; - proxy_cache_bypass 1; -} \ No newline at end of file + location = /server-status { + proxy_no_cache 1; + proxy_cache_bypass 1; + } \ No newline at end of file diff --git a/overlay/etc/nginx/sites-available/cache.conf.d/root/10_loop_detection.conf b/overlay/etc/nginx/sites-available/cache.conf.d/root/10_loop_detection.conf index 067989c..478ad36 100644 --- a/overlay/etc/nginx/sites-available/cache.conf.d/root/10_loop_detection.conf +++ b/overlay/etc/nginx/sites-available/cache.conf.d/root/10_loop_detection.conf @@ -1,7 +1,7 @@ - # Abort any circular requests - if ($http_X_LanCache_Processed_By = $hostname) { - return 508; - } + # Abort any circular requests + if ($http_X_LanCache_Processed_By = $hostname) { + return 508; + } - proxy_set_header X-LanCache-Processed-By $hostname; - add_header X-LanCache-Processed-By $hostname,$http_X_LanCache_Processed_By; + proxy_set_header X-LanCache-Processed-By $hostname; + add_header X-LanCache-Processed-By $hostname,$http_X_LanCache_Processed_By; diff --git a/overlay/etc/nginx/stream-available/10_sni.conf b/overlay/etc/nginx/stream-available/10_sni.conf index aa28f67..40161a3 100644 --- a/overlay/etc/nginx/stream-available/10_sni.conf +++ b/overlay/etc/nginx/stream-available/10_sni.conf @@ -1,6 +1,6 @@ server { listen 443; - resolver UPSTREAM_DNS ipv6=off; + resolver UPSTREAM_DNS ipv6=off; proxy_pass $ssl_preread_server_name:443; ssl_preread on;