[edit] Part solution
In addition to the instructions in the link, make the paths relative in frontend/config.json (in /srv/modoboa/instance)
{
"API_BASE_URL": "/api/v2",
"API_DOC_URL": "/api/schema-v2/swagger/",
"OAUTH_AUTHORITY_URL": "/api/o",
"OAUTH_CLIENT_ID": "blablabla",
"OAUTH_REDIRECT_URI": "/login/logged",
"OAUTH_POST_REDIRECT_URI": ""
}
and I also added this in the nginx conf, don’t remember if all was useful. In mail.domain2.com.conf
location ~ ^/(api|accounts|autodiscover) {
include uwsgi_params;
uwsgi_param UWSGI_SCRIPT instance.wsgi:application;
uwsgi_param Host $host;
uwsgi_param X-Forwarded-Host $host;
uwsgi_param X-Forwarded-Proto $scheme;
uwsgi_param X-Real-IP $remote_addr;
uwsgi_pass modoboa;
}
...
location /radicale/ {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
...
}
As many have advised against it, I decided to start (almost self-)hosting my mail service.
I have tried with one domain, it has been running fine so far. I have not tested deeply but it works.
I want to host another domain, so I followed this guide which seems mostly still applicable: https://www.linuxbabe.com/mail-server/modoboa-multiple-domains
One thing though, with the current basic modoboa install, after following the steps in this guide, I can go to mail.domain2.com to access the webmail, however it is some kind of redirect and I end up on mail.domain.com. It must be on wsgi level because there is no redirect in nginx? So technically it’s still working since it’s what’s actually under the hood. But would it be possible to stay on mail.domain2.com?
Or maybe I have missed something somewhere, because unlike mentioned in the guide, it seems I have to use mail.domain1.com to set up client IMAP and not mail.domain2.com.
I know this is not a modoboa support community but I am not going to create one (yet) and I am not going to reddit. And I can’t open issues in Github. So live with it.


The nginx conf has a https redirect, but I have a separate conf for domain2, and the redirect is correctly going to domain2.