mirror of
https://github.com/lancachenet/monolithic
synced 2025-02-16 21:08:26 +00:00
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:
parent
83d9ffdcae
commit
566df584bb
6 changed files with 33 additions and 6 deletions
|
@ -17,6 +17,9 @@ ENV GENERICCACHE_VERSION=2 \
|
||||||
CACHE_DOMAINS_BRANCH=master \
|
CACHE_DOMAINS_BRANCH=master \
|
||||||
NGINX_WORKER_PROCESSES=auto
|
NGINX_WORKER_PROCESSES=auto
|
||||||
|
|
||||||
|
RUN apt-get update ;\
|
||||||
|
apt-get install -y jq git ;
|
||||||
|
|
||||||
COPY overlay/ /
|
COPY overlay/ /
|
||||||
|
|
||||||
RUN rm /etc/nginx/sites-enabled/* /etc/nginx/stream-enabled/* ;\
|
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/ ;\
|
chown -R ${WEBUSER}:${WEBUSER} /data/ ;\
|
||||||
mkdir -p /etc/nginx/sites-enabled ;\
|
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/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
|
ln -s /etc/nginx/stream-available/10_sni.conf /etc/nginx/stream-enabled/10_sni.conf
|
||||||
|
|
||||||
RUN mkdir -m 755 -p /data/cachedomains ;\
|
RUN mkdir -m 755 -p /data/cachedomains ;\
|
||||||
mkdir -m 755 -p /tmp/nginx ;\
|
mkdir -m 755 -p /tmp/nginx
|
||||||
apt-get update ;\
|
|
||||||
apt-get install -y jq git ;
|
|
||||||
|
|
||||||
RUN git clone --depth=1 --no-single-branch https://github.com/uklans/cache-domains/ /data/cachedomains
|
RUN git clone --depth=1 --no-single-branch https://github.com/uklans/cache-domains/ /data/cachedomains
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ http {
|
||||||
error_log /var/log/nginx/error.log;
|
error_log /var/log/nginx/error.log;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
|
|
||||||
include /etc/nginx/conf.d/*.conf;
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
|
|
@ -31,5 +31,3 @@
|
||||||
|
|
||||||
# 40G max file
|
# 40G max file
|
||||||
proxy_max_temp_file_size 40960m;
|
proxy_max_temp_file_size 40960m;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# Upstream Configuration
|
# Upstream Configuration
|
||||||
proxy_next_upstream error timeout http_404;
|
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_redirect off;
|
||||||
proxy_ignore_client_abort on;
|
proxy_ignore_client_abort on;
|
||||||
|
|
||||||
|
|
23
overlay/etc/nginx/sites-available/upstream.conf
Normal file
23
overlay/etc/nginx/sites-available/upstream.conf
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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/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/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/stream-available/10_sni.conf
|
||||||
|
sed -i "s/UPSTREAM_DNS/${UPSTREAM_DNS}/" /etc/nginx/sites-available/upstream.conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue