Temporary addition of upsteam proxy for PS5 testing

Addition of Upstream proxy from #60 to test 302 cache impact on PS5
caching
This commit is contained in:
VibroAxe 2022-03-07 00:10:29 +00:00
parent 83d9ffdcae
commit 566df584bb
6 changed files with 33 additions and 6 deletions

View file

@ -17,6 +17,9 @@ 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/* ;\
@ -31,12 +34,11 @@ RUN rm /etc/nginx/sites-enabled/* /etc/nginx/stream-enabled/* ;\
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/upstream.conf /etc/nginx/sites-enabled/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 ;\
apt-get update ;\
apt-get install -y jq git ;
mkdir -m 755 -p /tmp/nginx
RUN git clone --depth=1 --no-single-branch https://github.com/uklans/cache-domains/ /data/cachedomains

View file

@ -25,6 +25,7 @@ http {
error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/*.conf;

View file

@ -31,5 +31,3 @@
# 40G max file
proxy_max_temp_file_size 40960m;

View file

@ -1,6 +1,8 @@
# Upstream Configuration
proxy_next_upstream error timeout http_404;
proxy_pass http://$host$request_uri;
# proxy_pass http://$host$request_uri;
proxy_pass http://127.0.0.1:3128$request_uri;
proxy_redirect off;
proxy_ignore_client_abort on;

View file

@ -0,0 +1,23 @@
server {
listen 3128 reuseport;
set $orig_loc 'upstream';
# access_log /data/logs/upstream-access.log cachelog;
error_log /data/logs/upstream-error.log;
resolver UPSTREAM_DNS ipv6=off;
location / {
proxy_pass http://$host$request_uri;
proxy_intercept_errors on;
error_page 301 302 307 = @upstream_redirect;
}
location @upstream_redirect {
set $saved_upstream_location '$upstream_http_location';
set $orig_loc 'upstream-302';
proxy_pass $saved_upstream_location;
}
}

View file

@ -18,3 +18,4 @@ sed -i "s/CACHE_MAX_AGE/${CACHE_MAX_AGE}/" /etc/nginx/sites-available/cache.c
sed -i "s/slice 1m;/slice ${CACHE_SLICE_SIZE};/" /etc/nginx/sites-available/cache.conf.d/root/20_cache.conf
sed -i "s/UPSTREAM_DNS/${UPSTREAM_DNS}/" /etc/nginx/sites-available/cache.conf.d/10_root.conf
sed -i "s/UPSTREAM_DNS/${UPSTREAM_DNS}/" /etc/nginx/stream-available/10_sni.conf
sed -i "s/UPSTREAM_DNS/${UPSTREAM_DNS}/" /etc/nginx/sites-available/upstream.conf