Skip to content

Commit 4a9d15b

Browse files
committed
Added alias domains for nginx
Fixes #39
1 parent 7b16c33 commit 4a9d15b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docker/nginx/conf/vhost.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ server {
22
listen 80;
33
listen 8000;
44

5-
server_name docker;
5+
server_name <ALIAS_DOMAIN> docker;
66
access_log /dev/stdout;
77
error_log /dev/stdout info;
88

docker/nginx/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
# Detect correct path of document root
88
DOCUMENT_ROOT=$(readlink -f "/docker/$DOCUMENT_ROOT")
99

10+
ALIAS_DOMAIN=""
11+
for DOMAIN in $DNS_DOMAIN; do
12+
ALIAS_DOMAIN="${ALIAS_DOMAIN} *.${DOMAIN}"
13+
done
14+
1015
rm -f -- /etc/nginx/conf.d/*.conf
1116
cp /opt/docker/vhost.conf /etc/nginx/conf.d/vhost.conf
1217
/bin/sed -i "s@<DOCUMENT_ROOT>@${DOCUMENT_ROOT}@" /etc/nginx/conf.d/vhost.conf
@@ -16,6 +21,7 @@ cp /opt/docker/vhost.conf /etc/nginx/conf.d/vhost.conf
1621
/bin/sed -i "s@<FLOW_REWRITEURLS>@${FLOW_REWRITEURLS}@" /etc/nginx/conf.d/vhost.conf
1722
/bin/sed -i "s@<FPM_HOST>@${MAIN_PORT_9000_TCP_ADDR}@" /etc/nginx/conf.d/vhost.conf
1823
/bin/sed -i "s@<FPM_PORT>@${MAIN_PORT_9000_TCP_PORT}@" /etc/nginx/conf.d/vhost.conf
24+
/bin/sed -i "s@<ALIAS_DOMAIN>@${ALIAS_DOMAIN}@" /etc/nginx/conf.d/vhost.conf
1925

2026
#############################
2127
## COMMAND

0 commit comments

Comments
 (0)