Skip to content

Commit 8853e2c

Browse files
committed
[Nginx] Use SOGo IPv4 for upstream
1 parent d1af52b commit 8853e2c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

data/Dockerfiles/nginx/bootstrap.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ def nginx_conf(env, template_vars):
2020
f.write(config)
2121

2222
def prepare_template_vars():
23+
ipv4_network = os.getenv("IPV4_NETWORK", "172.22.1")
2324
template_vars = {
24-
'IPV4_NETWORK': os.getenv("IPV4_NETWORK", "172.22.1"),
25+
'IPV4_NETWORK': ipv4_network,
2526
'TRUSTED_NETWORK': os.getenv("TRUSTED_NETWORK", False),
2627
'SKIP_RSPAMD': os.getenv("SKIP_RSPAMD", "n").lower() in ("y", "yes"),
2728
'SKIP_SOGO': os.getenv("SKIP_SOGO", "n").lower() in ("y", "yes"),
@@ -30,7 +31,7 @@ def prepare_template_vars():
3031
'ADDITIONAL_SERVER_NAMES': os.getenv("ADDITIONAL_SERVER_NAMES", "").replace(',', ' '),
3132
'HTTP_PORT': os.getenv("HTTP_PORT", "80"),
3233
'HTTPS_PORT': os.getenv("HTTPS_PORT", "443"),
33-
'SOGOHOST': os.getenv("SOGOHOST", "sogo-mailcow"),
34+
'SOGOHOST': os.getenv("SOGOHOST", ipv4_network + ".248"),
3435
'RSPAMDHOST': os.getenv("RSPAMDHOST", "rspamd-mailcow"),
3536
'PHPFPMHOST': os.getenv("PHPFPMHOST", "php-fpm-mailcow"),
3637
}

data/Dockerfiles/nginx/docker-entrypoint.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/sh
22

3-
until ping ${REDISHOST} -c1 > /dev/null; do
4-
echo "Waiting for Redis..."
5-
sleep 1
6-
done
3+
PHPFPMHOST=${PHPFPMHOST:-"php-fpm-mailcow"}
4+
SOGOHOST=${SOGOHOST:-"$IPV4_NETWORK.248"}
5+
RSPAMDHOST=${RSPAMDHOST:-"rspamd-mailcow"}
6+
77
until ping ${PHPFPMHOST} -c1 > /dev/null; do
88
echo "Waiting for PHP..."
99
sleep 1

docker-compose.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,10 @@ services:
382382
- TZ=${TZ}
383383
- SKIP_SOGO=${SKIP_SOGO:-n}
384384
- SKIP_RSPAMD=${SKIP_RSPAMD:-n}
385-
- PHPFPMHOST=${PHPFPMHOST:-php-fpm-mailcow}
386-
- SOGOHOST=${SOGOHOST:-sogo-mailcow}
387-
- RSPAMDHOST=${RSPAMDHOST:-rspamd-mailcow}
388-
- REDISHOST=${REDISHOST:-redis-mailcow}
385+
- PHPFPMHOST=${PHPFPMHOST:-}
386+
- SOGOHOST=${SOGOHOST:-}
387+
- RSPAMDHOST=${RSPAMDHOST:-}
388+
- REDISHOST=${REDISHOST:-}
389389
- IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
390390
volumes:
391391
- ./data/web:/web:ro,z

0 commit comments

Comments
 (0)