diff --git a/data/conf/nginx/includes/site-defaults.conf b/data/conf/nginx/includes/site-defaults.conf index c4c06b2a..34bd7256 100644 --- a/data/conf/nginx/includes/site-defaults.conf +++ b/data/conf/nginx/includes/site-defaults.conf @@ -116,6 +116,14 @@ proxy_redirect off; } + location /xmpp/ { + proxy_pass http://ejabberd:5282/xmpp/; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Real-IP $remote_addr; + proxy_redirect off; + } + location ~* ^/Autodiscover/Autodiscover.xml { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass phpfpm:9002; diff --git a/data/web/inc/functions.xmpp.inc.php b/data/web/inc/functions.xmpp.inc.php index 90b370ee..c5a2d692 100644 --- a/data/web/inc/functions.xmpp.inc.php +++ b/data/web/inc/functions.xmpp.inc.php @@ -235,6 +235,14 @@ EOF; } fwrite($acl_handle, '# Autogenerated by mailcow' . PHP_EOL); fclose($acl_handle); + + // Write empty Nginx site + $acl_handle = fopen('/etc/nginx/conf.d/ZZZ-ejabberd.conf', 'w'); + if (!$acl_handle) { + throw new Exception($lang['danger']['file_open_error']); + } + fwrite($acl_handle, '# Autogenerated by mailcow' . PHP_EOL); + fclose($acl_handle); } if (md5_file('/ejabberd/ejabberd_acl.yml') != $ejabberd_acl_md5) {