Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ WORKDIR /opt

RUN apk add --no-cache gettext

COPY auth.conf auth.htpasswd launch.sh ./
COPY auth.conf healthcheck.conf auth.htpasswd launch.sh ./

HEALTHCHECK CMD wget -q http://localhost:80/ || exit 1

CMD ["./launch.sh"]
17 changes: 10 additions & 7 deletions auth.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
server {
listen 80 default_server;
listen 80 default_server;

location / {
auth_basic "Restricted";
auth_basic_user_file auth.htpasswd;
location / {
satisfy any;
allow 127.0.0.1;
deny all;
auth_basic "Restricted";
auth_basic_user_file auth.htpasswd;

proxy_pass http://${FORWARD_HOST}:${FORWARD_PORT};
proxy_read_timeout 900;
}
proxy_pass http://${FORWARD_HOST}:${FORWARD_PORT};
proxy_read_timeout 900;
}
}
8 changes: 8 additions & 0 deletions healthcheck.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 9999 default_server;

location / {
proxy_pass http://${FORWARD_HOST}:${FORWARD_PORT};
proxy_read_timeout 900;
}
}
1 change: 1 addition & 0 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

rm /etc/nginx/conf.d/default.conf || :
envsubst < auth.conf > /etc/nginx/conf.d/auth.conf
envsubst < healthcheck.conf > /etc/nginx/conf.d/healthcheck.conf
envsubst < auth.htpasswd > /etc/nginx/auth.htpasswd

nginx -g "daemon off;"