mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-12-20 05:11:30 +00:00
Use consistent naming for host-related env vars
This commit is contained in:
@@ -8,9 +8,9 @@ class BootstrapNginx(BootstrapBase):
|
|||||||
self.connect_mysql()
|
self.connect_mysql()
|
||||||
|
|
||||||
# wait for Hosts
|
# wait for Hosts
|
||||||
php_service = os.getenv("PHPFPMHOST") or "php-fpm-mailcow"
|
php_service = os.getenv("PHPFPM_HOST") or "php-fpm-mailcow"
|
||||||
rspamd_service = os.getenv("RSPAMDHOST") or "rspamd-mailcow"
|
rspamd_service = os.getenv("RSPAMD_HOST") or "rspamd-mailcow"
|
||||||
sogo_service = os.getenv("SOGOHOST")
|
sogo_service = os.getenv("SOGO_HOST")
|
||||||
self.wait_for_host(php_service)
|
self.wait_for_host(php_service)
|
||||||
if not self.isYes(os.getenv("SKIP_RSPAMD", False)):
|
if not self.isYes(os.getenv("SKIP_RSPAMD", False)):
|
||||||
self.wait_for_host(rspamd_service)
|
self.wait_for_host(rspamd_service)
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ location ~ ^/cache/(.*)$ {
|
|||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass {{ PHPFPMHOST }}:9002;
|
fastcgi_pass {{ PHPFPM_HOST }}:9002;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
@@ -115,7 +115,7 @@ location ~ \.php$ {
|
|||||||
|
|
||||||
location ~* ^/Autodiscover/Autodiscover.xml {
|
location ~* ^/Autodiscover/Autodiscover.xml {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass {{ PHPFPMHOST }}:9002;
|
fastcgi_pass {{ PHPFPM_HOST }}:9002;
|
||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
try_files /autodiscover.php =404;
|
try_files /autodiscover.php =404;
|
||||||
@@ -123,7 +123,7 @@ location ~* ^/Autodiscover/Autodiscover.xml {
|
|||||||
|
|
||||||
location ~* ^/Autodiscover/Autodiscover.json {
|
location ~* ^/Autodiscover/Autodiscover.json {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass {{ PHPFPMHOST }}:9002;
|
fastcgi_pass {{ PHPFPM_HOST }}:9002;
|
||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
try_files /autodiscover-json.php =404;
|
try_files /autodiscover-json.php =404;
|
||||||
@@ -131,7 +131,7 @@ location ~* ^/Autodiscover/Autodiscover.json {
|
|||||||
|
|
||||||
location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
|
location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
fastcgi_pass {{ PHPFPMHOST }}:9002;
|
fastcgi_pass {{ PHPFPM_HOST }}:9002;
|
||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
try_files /autoconfig.php =404;
|
try_files /autoconfig.php =404;
|
||||||
@@ -141,7 +141,7 @@ location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
|
|||||||
location /rspamd/ {
|
location /rspamd/ {
|
||||||
location /rspamd/auth {
|
location /rspamd/auth {
|
||||||
# proxy_pass is not inherited
|
# proxy_pass is not inherited
|
||||||
proxy_pass http://{{ RSPAMDHOST }}:11334/auth;
|
proxy_pass http://{{ RSPAMD_HOST }}:11334/auth;
|
||||||
proxy_intercept_errors on;
|
proxy_intercept_errors on;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
||||||
@@ -150,7 +150,7 @@ location /rspamd/ {
|
|||||||
error_page 401 /_rspamderror.php;
|
error_page 401 /_rspamderror.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass http://{{ RSPAMDHOST }}:11334/;
|
proxy_pass http://{{ RSPAMD_HOST }}:11334/;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
||||||
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
||||||
@@ -182,7 +182,7 @@ location ^~ /Microsoft-Server-ActiveSync {
|
|||||||
proxy_set_header Authorization "$auth";
|
proxy_set_header Authorization "$auth";
|
||||||
proxy_set_header x-webobjects-auth-type "$auth_type";
|
proxy_set_header x-webobjects-auth-type "$auth_type";
|
||||||
|
|
||||||
proxy_pass http://{{ SOGOHOST }}:20000/SOGo/Microsoft-Server-ActiveSync;
|
proxy_pass http://{{ SOGO_HOST }}:20000/SOGo/Microsoft-Server-ActiveSync;
|
||||||
|
|
||||||
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
||||||
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
||||||
@@ -207,7 +207,7 @@ location ^~ /SOGo {
|
|||||||
proxy_set_header Authorization "$auth";
|
proxy_set_header Authorization "$auth";
|
||||||
proxy_set_header x-webobjects-auth-type "$auth_type";
|
proxy_set_header x-webobjects-auth-type "$auth_type";
|
||||||
|
|
||||||
proxy_pass http://{{ SOGOHOST }}:20000;
|
proxy_pass http://{{ SOGO_HOST }}:20000;
|
||||||
|
|
||||||
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
||||||
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
||||||
@@ -229,7 +229,7 @@ location ^~ /SOGo {
|
|||||||
proxy_set_header Authorization "$auth";
|
proxy_set_header Authorization "$auth";
|
||||||
proxy_set_header x-webobjects-auth-type "$auth_type";
|
proxy_set_header x-webobjects-auth-type "$auth_type";
|
||||||
|
|
||||||
proxy_pass http://{{ SOGOHOST }}:20000;
|
proxy_pass http://{{ SOGO_HOST }}:20000;
|
||||||
|
|
||||||
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
|
||||||
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
|
||||||
|
|||||||
@@ -439,10 +439,10 @@ services:
|
|||||||
- SKIP_RSPAMD=${SKIP_RSPAMD:-n}
|
- SKIP_RSPAMD=${SKIP_RSPAMD:-n}
|
||||||
- DISABLE_IPv6=${DISABLE_IPv6:-n}
|
- DISABLE_IPv6=${DISABLE_IPv6:-n}
|
||||||
- HTTP_REDIRECT=${HTTP_REDIRECT:-n}
|
- HTTP_REDIRECT=${HTTP_REDIRECT:-n}
|
||||||
- PHPFPMHOST=${PHPFPMHOST:-php-fpm-mailcow}
|
- PHPFPM_HOST=${PHPFPM_HOST:-php-fpm-mailcow}
|
||||||
- RSPAMDHOST=${RSPAMDHOST:-rspamd-mailcow}
|
- RSPAM_DHOST=${RSPAMD_HOST:-rspamd-mailcow}
|
||||||
- SOGOHOST=${SOGOHOST:-${IPV4_NETWORK:-172.22.1}.248}
|
- SOGO_HOST=${SOGO_HOST:-${IPV4_NETWORK:-172.22.1}.248}
|
||||||
- REDISHOST=${REDISHOST:-redis-mailcow}
|
- REDIS_HOST=${REDIS_HOST:-redis-mailcow}
|
||||||
- IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
|
- IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
|
||||||
- NGINX_USE_PROXY_PROTOCOL=${NGINX_USE_PROXY_PROTOCOL:-n}
|
- NGINX_USE_PROXY_PROTOCOL=${NGINX_USE_PROXY_PROTOCOL:-n}
|
||||||
- TRUSTED_PROXIES=${TRUSTED_PROXIES:-}
|
- TRUSTED_PROXIES=${TRUSTED_PROXIES:-}
|
||||||
|
|||||||
Reference in New Issue
Block a user