mailcow-dockerized-docs/docs/u_e-webmail-site.md

39 Zeilen
1,2 KiB
Markdown

2019-11-13 22:01:38 +01:00
**Edit**: TODO: This guide only applies to non SNI enabled configurations. The certificate path needs to be adjusted if SNI is enabled. Something like `ssl_certificate,key /etc/ssl/mail/webmail.example.org/cert.pem,key.pem;` will do.
2019-08-11 14:46:08 +02:00
To create a subdomain `webmail.example.org` and redirect it to SOGo, you need to create a **new** Nginx site. Take care of "CHANGE_TO_MAILCOW_HOSTNAME"!
2019-05-05 23:08:00 +02:00
**nano data/conf/nginx/webmail.conf**
2019-08-11 14:46:08 +02:00
2019-07-30 14:41:28 +02:00
``` hl_lines="9 17"
2019-05-05 23:08:00 +02:00
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;
2019-07-02 23:11:36 +02:00
root /web;
2019-05-05 23:08:00 +02:00
include /etc/nginx/conf.d/listen_plain.active;
include /etc/nginx/conf.d/listen_ssl.active;
server_name webmail.example.org;
location ^~ /.well-known/acme-challenge/ {
allow all;
default_type "text/plain";
}
location / {
return 301 https://CHANGE_TO_MAILCOW_HOSTNAME/SOGo;
}
}
```
Save and restart Nginx: `docker-compose restart nginx-mailcow`.
Now open `mailcow.conf` and find `ADDITIONAL_SAN`.
Add `webmail.example.org` to this array, don't use quotes!
```
ADDITIONAL_SAN=webmail.example.org
```
Run `docker-compose up -d`. See "acme-mailcow" and "nginx-mailcow" logs if anything fails.