Verified Commit ac919baf authored by EorlBruder's avatar EorlBruder
Browse files

feat(clock): add to reverse proxy

parent 8c76d968
Pipeline #1772 passed with stage
in 3 minutes and 24 seconds
......@@ -28,6 +28,7 @@ RUN apk add certbot certbot-nginx
COPY nginx/nginx.prod.template /etc/nginx/conf.d/nginx.template
RUN mkdir /etc/nginx/conf.d/locations
COPY nginx/icecast.conf /etc/nginx/conf.d/locations/icecast.conf
COPY nginx/clock.conf /etc/nginx/conf.d/locations/clock.conf
COPY nginx/run.sh /run.sh
COPY --from=prod_builder /dashboard/dist /usr/share/nginx/html
......
location /clock/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_pass http://dashboard-clock:80/;
proxy_redirect $scheme://$host/ /;
proxy_redirect ~^/?(.*)$ $scheme://$host:$server_port/clock/$1;
sub_filter 'href="/' 'href="/clock/';
sub_filter 'src="/' 'src="/clock/';
sub_filter 'action="/' 'action="/clock/';
sub_filter_once off;
}
......@@ -59,4 +59,5 @@ server {
proxy_pass http://tank:8040/;
}
include /etc/nginx/conf.d/locations/icecast.conf;
include /etc/nginx/conf.d/locations/clock.conf;
}
......@@ -14,11 +14,18 @@ do
done
if [ $INCLUDE_ICECAST == "true" ]; then
sed -Ei 's/^#([[:blank:]]*include \/etc\/nginx\/conf.d\/locations\/icecast.conf;)/\1/' default.conf
sed -Ei 's/^#([[:blank:]]*include \/etc\/nginx\/conf.d\/locations\/icecast.conf;)/\1/' /etc/nginx/conf.d/default.conf
else
sed -i 's/^[[:blank:]]*include \/etc\/nginx\/conf.d\/locations\/icecast.conf;/#&/' /etc/nginx/conf.d/default.conf
fi
if [ $INCLUDE_CLOCK == "true" ]; then
sed -Ei 's/^#([[:blank:]]*include \/etc\/nginx\/conf.d\/locations\/clock.conf;)/\1/' /etc/nginx/conf.d/default.conf
else
sed -i 's/^[[:blank:]]*include \/etc\/nginx\/conf.d\/locations\/clock.conf;/#&/' /etc/nginx/conf.d/default.conf
fi
echo "generated nginx-config"
if [ $RUN_CERTBOT == "true" ]; then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment