Home » Create a sub-domain for webmail in mailcow

Create a sub-domain for webmail in mailcow

0 comment 169 views

According the the office guide, below steps are for create a sub-domain for webmail in mailcow.

1. Create a file – nano data/conf/nginx/webmail.conf

server {
  ssl_certificate /etc/ssl/mail/cert.pem;
  ssl_certificate_key /etc/ssl/mail/key.pem;
  index index.php index.html;
  client_max_body_size 0;
  root /web;
  include /etc/nginx/conf.d/listen_plain.active;
  include /etc/nginx/conf.d/listen_ssl.active;
  server_name webmail.example.org;
  server_tokens off;
  location ^~ /.well-known/acme-challenge/ {
    allow all;
    default_type "text/plain";
  }

  location / {
    return 301 https://CHANGE_TO_MAILCOW_HOSTNAME/SOGo;
  }
}

2. Restart nginx docker service

docker compose restart nginx-mailcow

3. Edit mailcow.conf and find ADDITIONAL_SAN. Add webmail.example.org

ADDITIONAL_SAN=webmail.example.org

4. Restart mailcow docker

docker compose up -d

Refer – https://docs.mailcow.email/manual-guides/Nginx/u_e-nginx_webmail-site/

Leave a Comment