Skip to content

Commit 31ceb7d

Browse files
committed
Add default host
1 parent 9f84c2c commit 31ceb7d

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed

.env.sample

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,14 @@ DOCKER_HTTPS=443
110110
# replaced by the LETSENCRYPT_EMAIL environment varibale present in your docker container
111111
#
112112
DEFAULT_EMAIL=mail@yourdomain.tld
113+
114+
#-----------------------------------------------------------------------
115+
#
116+
# Default host
117+
#
118+
# Nginx-proxy will then redirect all requests to a container where VIRTUAL_HOST
119+
# is set to DEFAULT_HOST, if they don't match any (other) VIRTUAL_HOST, you
120+
# might want to check the link below for more information:
121+
# https://github.com/nginx-proxy/nginx-proxy#default-host
122+
#
123+
DEFAULT_HOST=

bin/fresh-start.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,17 @@ while [[ $# -gt 0 ]]; do
452452
shift 1
453453
;;
454454

455+
# Default host
456+
--default-host=*)
457+
ARG_DEFAULT_HOST="${1#*=}"
458+
if [[ $ARG_DEFAULT_HOST == "" ]]; then
459+
echoerror "Invalid option for --default-host"
460+
break
461+
fi
462+
shift 1
463+
;;
464+
465+
# Other options
455466
--update-nginx-template)
456467
UPDATE_NGINX_TEMPLATE=true
457468
shift 1

bin/localscript/update-env-new-site-variables.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,8 @@ local_update_env_new_site_variables()
7575
# Default email address
7676
run_function env_update_variable $LOCAL_FILE_PATH "DEFAULT_EMAIL" "$DEFAULT_EMAIL"
7777

78+
# Default host
79+
run_function env_update_variable $LOCAL_FILE_PATH "DEFAULT_HOST" "$ARG_DEFAULT_HOST"
80+
7881
return 0
7982
}

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ services:
1414
# - "${IPv6:-::0}:${DOCKER_HTTPS:-443}:443"
1515
environment:
1616
SSL_POLICY: ${SSL_POLICY:-Mozilla-Intermediate}
17+
DEFAULT_HOST: ${DEFAULT_HOST:-localhost}
1718
# ENABLE_IPV6: "true"
1819
volumes:
1920
- ${NGINX_FILES_PATH:-./data}/conf.d:/etc/nginx/conf.d

0 commit comments

Comments
 (0)