We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 648516b + e4eb534 commit 3b76d8cCopy full SHA for 3b76d8c
Dockerfile
@@ -1,7 +1,8 @@
1
FROM nginx:alpine
2
3
ENV HTPASSWD='foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.' \
4
- FORWARD_PORT=80
+ FORWARD_PORT=80 \
5
+ FORWARD_HOST=web
6
7
WORKDIR /opt
8
auth.conf
@@ -1,11 +1,11 @@
server {
listen 80 default_server;
-
+
location / {
auth_basic "Restricted";
auth_basic_user_file auth.htpasswd;
- proxy_pass http://web:${FORWARD_PORT};
+ proxy_pass http://${FORWARD_HOST}:${FORWARD_PORT};
9
proxy_read_timeout 900;
10
}
11
-}
+}
launch.sh
@@ -1,5 +1,6 @@
#!/bin/sh
+rm /etc/nginx/conf.d/default.conf || :
envsubst < auth.conf > /etc/nginx/conf.d/auth.conf
envsubst < auth.htpasswd > /etc/nginx/auth.htpasswd
0 commit comments