esackbauer
Sorry for the late reply, but it took some time until I got it to work ;-)
Maybe this is of interest for somebody who wants to make the same thing.
My understanding is that adding a mount via docker-compose.override.yml should not harm the mailcow installation.
Same for adding a config to data/config/nginx.
Here is the summary what worked for me.
Go to the mailcow installation:
cd /opt/mailcow-dockerized
Edit mailcow.conf to include the additional domain into the cert stuff:
ADDITIONAL_SAN=www.example.de,example.de
Add an additional domain to nginx by adding a new config file /opt/mailcow-dockerized/data/conf/nginx/example-de.conf:
server {
server_name example.de;
return 301 $scheme://www.example.de$request_uri;
}
server {
ssl_certificate /etc/ssl/mail/cert.pem;
ssl_certificate_key /etc/ssl/mail/key.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
ssl_ecdh_curve X25519:X448:secp384r1:secp256k1;
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 1d;
ssl_session_tickets off;
index index.php index.html;
client_max_body_size 0;
root /www/example.de;
include /etc/nginx/conf.d/listen_plain.active;
include /etc/nginx/conf.d/listen_ssl.active;
server_name www.example.de;
server_tokens off;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
rewrite /.well-known/acme-challenge/(.*) /$1 break;
root /web/.well-known/acme-challenge/;
}
error_page 401 /error/401.html;
error_page 403 /error/403.html;
error_page 404 /error/404.html;
error_page 500 /error/500.html;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
}
Add the data for the domain somewhere:
mkdir -p www/example.de
echo "Back soon" > www/example.de/index.html
Add an addtional mount for nginx to access the data with docker-compose.override.yml
services:
nginx-mailcow:
volumes:
- ./www:/www:ro,z
restart
docker compose down
docker compose up -d