Fixed spacing & indents

This commit is contained in:
VibroAxe 2022-11-12 11:49:43 +00:00
parent a27bb4d77c
commit 6f1fbbe617
8 changed files with 49 additions and 50 deletions

View file

@ -3,6 +3,9 @@ LABEL version=3
LABEL description="Single caching container for caching game content at LAN parties."
LABEL maintainer="LanCache.Net Team <team@lancache.net>"
RUN apt-get update ;\
apt-get install -y jq git ;
ENV GENERICCACHE_VERSION=2 \
CACHE_MODE=monolithic \
WEBUSER=www-data \
@ -17,9 +20,6 @@ ENV GENERICCACHE_VERSION=2 \
CACHE_DOMAINS_BRANCH=master \
NGINX_WORKER_PROCESSES=auto
RUN apt-get update ;\
apt-get install -y jq git ;
COPY overlay/ /
RUN rm /etc/nginx/sites-enabled/* /etc/nginx/stream-enabled/* ;\
@ -27,18 +27,17 @@ RUN rm /etc/nginx/sites-enabled/* /etc/nginx/stream-enabled/* ;\
chmod 754 /var/log/tallylog ; \
id -u ${WEBUSER} &> /dev/null || adduser --system --home /var/www/ --no-create-home --shell /bin/false --group --disabled-login ${WEBUSER} ;\
chmod 755 /scripts/* ;\
mkdir -m 755 -p /data/cache ;\
mkdir -m 755 -p /data/info ;\
mkdir -m 755 -p /data/logs ;\
mkdir -m 755 -p /tmp/nginx/ ;\
chown -R ${WEBUSER}:${WEBUSER} /data/ ;\
mkdir -p /etc/nginx/sites-enabled ;\
ln -s /etc/nginx/sites-available/10_cache.conf /etc/nginx/sites-enabled/10_generic.conf; \
ln -s /etc/nginx/sites-available/20_upstream.conf /etc/nginx/sites-enabled/20_upstream.conf; \
ln -s /etc/nginx/stream-available/10_sni.conf /etc/nginx/stream-enabled/10_sni.conf
RUN mkdir -m 755 -p /data/cachedomains ;\
mkdir -m 755 -p /tmp/nginx
mkdir -m 755 -p /data/cache ;\
mkdir -m 755 -p /data/info ;\
mkdir -m 755 -p /data/logs ;\
mkdir -m 755 -p /tmp/nginx/ ;\
chown -R ${WEBUSER}:${WEBUSER} /data/ ;\
mkdir -p /etc/nginx/sites-enabled ;\
ln -s /etc/nginx/sites-available/10_cache.conf /etc/nginx/sites-enabled/10_generic.conf; \
ln -s /etc/nginx/sites-available/20_upstream.conf /etc/nginx/sites-enabled/20_upstream.conf; \
ln -s /etc/nginx/stream-available/10_sni.conf /etc/nginx/stream-enabled/10_sni.conf; \
mkdir -m 755 -p /data/cachedomains ;\
mkdir -m 755 -p /tmp/nginx
RUN git clone --depth=1 --no-single-branch https://github.com/uklans/cache-domains/ /data/cachedomains

View file

@ -5,36 +5,37 @@ pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 4096;
multi_accept on;
use epoll;
worker_connections 4096;
multi_accept on;
use epoll;
}
http {
aio threads;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
aio threads;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*.conf;
include /etc/nginx/sites-enabled/*.conf;
}
stream {
include /etc/nginx/stream.d/*.conf;
include /etc/nginx/stream-enabled/*;
include /etc/nginx/stream.d/*.conf;
include /etc/nginx/stream-enabled/*;
}

View file

@ -5,10 +5,10 @@
server {
# Internal bind on 3128, this should not be externally mapped
# Internal bind on 3128, this should not be externally mapped
listen localhost:3128 reuseport;
# No access_log tracking as all requests to this instance are already logged through monolithic
# No access_log tracking as all requests to this instance are already logged through monolithic
# access_log /data/logs/upstream-access.log cachelog;
error_log /data/logs/upstream-error.log;

View file

@ -1,8 +1,7 @@
# Upstream Configuration
proxy_next_upstream error timeout http_404;
# proxy_pass http://$host$request_uri;
# Proxy into the redirect handler
# Proxy into the redirect handler
proxy_pass http://127.0.0.1:3128$request_uri;
proxy_redirect off;

View file

@ -1,2 +1,2 @@
# Header to track if resolved from upstream or 302 redirect
# Header to track if resolved from upstream or 302 redirect
set $orig_loc 'upstream';

View file

@ -1,9 +1,9 @@
# Proxy all requests to upstream
# Proxy all requests to upstream
location / {
# Simple proxy the request
proxy_pass http://$host$request_uri;
proxy_pass http://$host$request_uri;
# Catch the errors to process the redirects
# Catch the errors to process the redirects
proxy_intercept_errors on;
error_page 301 302 307 = @upstream_redirect;
}

View file

@ -1,11 +1,11 @@
# Special location block to handle 302 redirects
# Special location block to handle 302 redirects
location @upstream_redirect {
# Upstream_http_location contains the Location: redirection from the upstream server
# Upstream_http_location contains the Location: redirection from the upstream server
set $saved_upstream_location '$upstream_http_location';
# Set debug header
# Set debug header
set $orig_loc 'upstream-302';
# Pass to proxy and reproxy the request
# Pass to proxy and reproxy the request
proxy_pass $saved_upstream_location;
}

View file

@ -1,9 +1,9 @@
server {
listen 443;
listen 443;
resolver UPSTREAM_DNS ipv6=off;
proxy_pass $ssl_preread_server_name:443;
ssl_preread on;
proxy_pass $ssl_preread_server_name:443;
ssl_preread on;
access_log /data/logs/stream-access.log stream_basic;
error_log /data/logs/stream-error.log;
access_log /data/logs/stream-access.log stream_basic;
error_log /data/logs/stream-error.log;
}