fix multiple server name issue

This commit is contained in:
Asif Bacchus 2019-11-13 08:48:17 -07:00
parent 39466709ee
commit e6c21af933
2 changed files with 7 additions and 1 deletions

View File

@ -22,7 +22,7 @@ TZ=Area/Location
# delimited and "enclosed in quotes".
# This is NOT required if you are supplying your own server blocks via
# 'SERVERS_DIR'
SERVER_NAMES="domain.tld www.domain.tld server.domain.tld alt.domain.tld"
HOSTNAMES="domain.tld www.domain.tld server.domain.tld alt.domain.tld"
# Ports to expose on the HOST machine (container ALWAYS internally uses 80/443):
# If you need to use ports other than HTTP=80 and HTTPS=443, remember to set up

View File

@ -176,6 +176,7 @@ if [ -z "$SSL_CERT" ]; then
printf "${cyan}\nRunning SHELL on %s...${norm}\n" "$container_name"
docker run --rm -it --name ${container_name} \
--env-file ab-nginx.params \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
-p ${HTTP_PORT}:80 \
docker.asifbacchus.app/nginx/ab-nginx:latest /bin/sh
@ -184,6 +185,7 @@ if [ -z "$SSL_CERT" ]; then
printf "${cyan}\nRunning NGINX on %s...${norm}\n" "$container_name"
docker run -d --name ${container_name} \
--env-file ab-nginx.params \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
-p ${HTTP_PORT}:80 \
--restart unless-stopped \
@ -196,6 +198,7 @@ elif [ "$SSL_CERT" ] && [ "$TLS13_ONLY" = FALSE ]; then
printf "${cyan}\nRunning SHELL on %s (TLS 1.2)...${norm}\n" "$container_name"
docker run --rm -it --name ${container_name} \
--env-file ab-nginx.params \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
-v "$SSL_CERT":/certs/fullchain.pem:ro \
-v "$SSL_KEY":/certs/privkey.pem:ro \
@ -208,6 +211,7 @@ elif [ "$SSL_CERT" ] && [ "$TLS13_ONLY" = FALSE ]; then
printf "${cyan}\nRunning NGINX on %s (TLS 1.2)...${norm}\n" "$container_name"
docker run -d --name ${container_name} \
--env-file ab-nginx.params \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
-v "$SSL_CERT":/certs/fullchain.pem:ro \
-v "$SSL_KEY":/certs/privkey.pem:ro \
@ -224,6 +228,7 @@ elif [ "$SSL_CERT" ] && [ "$TLS13_ONLY" = TRUE ]; then
printf "${cyan}\nRunning SHELL on %s (TLS 1.3)...${norm}\n" "$container_name"
docker run --rm -it --name ${container_name} \
--env-file ab-nginx.params \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
-v "$SSL_CERT":/certs/fullchain.pem:ro \
-v "$SSL_KEY":/certs/privkey.pem:ro \
@ -235,6 +240,7 @@ elif [ "$SSL_CERT" ] && [ "$TLS13_ONLY" = TRUE ]; then
printf "${cyan}\nRunning NGINX on %s (TLS 1.3)...${norm}\n" "$container_name"
docker run -d --name ${container_name} \
--env-file ab-nginx.params \
-e SERVER_NAMES="$HOSTNAMES" \
$vmount \
-v "$SSL_CERT":/certs/fullchain.pem:ro \
-v "$SSL_KEY":/certs/privkey.pem:ro \