First, sorry to write here as it's a support request and not a real issue, but the forum is down.
I read https://mailcow.github.io/mailcow-dockerized-docs/firststeps-rp/ but it is not working.
I suspect the reason is that I run the reverse proxy in a container.
I'm new to Docker so a bit of help would be appreciated.
Thanks
P.S. I first searched many hours on the internet for a solution but could not find.
I can't help, sorry. Just wanted to add that I am curious about this also 馃槉
I wonder if it is enough to set network_mode: "host" and use Nginx' IP instead of hostname (DNS will likely fail to resolve) in the RP configuration.
I have running nginx running in a docker container as proxy and it is working perfectly.
Make sure you have your proxy container added to the mailcowdockerized_mailcow-network network.
And your proxy-pass rule needs to be: proxy_pass http://nginx-mailcow:8080/;.
I think this is not mentioned in the docs.
It is important that the external ips are given as x-headers to nginx-mailcow. @P0ly does docker-compose logs --tail=1000 nginx-mailcow show your external IP when accessing mailcow_hostname/rspamd ?
@andryyy Oh, actually not. Does this affect spam filtering?
Have no issue with it otherwise.
No. But you should disable the Rspamd web UI as everyone can login with any password.
Or you try to use network_mode host and proxy_pass to http://172.22.1.251:8080
@andryyy Wow, good that I posted this here.
How can I disable the web UI?
Should be enough to set static_dir = "/dev/null"; in data/conf/rspamd/override.d/worker-controller.inc.
I was almost able to make the reverse proxy to work.
I added mailcow-nginx to the reverse proxy network.
I wanted the mailcow webui to be in a directory, e.g. domain.com/mailcow
It kinda worked but all css, images, javascript and links were broken as they were refering to /css, /img, /js and not to /mailcow/css, etc.
Would there be any change possible to make that work?
Got already asked in #393.
I think this is what you are looking for:
https://serverfault.com/questions/650117/serving-multiple-proxy-endpoints-under-location-in-nginx
Maybe you can try that out.
It kinda worked but all css, images, javascript and links were broken as they were refering to /css, /img, /js and not to /mailcow/css, etc.
@jpbaril ill try to fix that up. For now, I suggest you to manually create a few redirect rules for these files.
Maybe proxy_redirect is of use here.
I'm thinking about linking the assets with relative urls without the leading foreslashes, so it wont break the RP out of the box. what do you think @andryyy?
it could work, but I have no idea if it breaks the API. :/
Well, if that's too complicated I can also have it in a subdomain. That's what I did for now. Thanks all for your answers and for Mailcow.
BTW, I used Caddy as a very simple reverse proxy.
It is important you setup Caddy as transparent proxy. Like...
proxy / 127.0.0.1:8080 {
transparent
}
Yeah, that's what I did except that instead of localhost I point to the Mailcow-nginx container's docker alias.
Thanks! ;-)
@jpbaril
Can you post your complete working caddy config? :)
It's almost as andryyy posted and also based on domains listed in mailcow docs about reverse proxy:
mailcow.domain.com, mail.domain.com, autodiscover.domain.com, autoconfig.domain.com {
proxy / mailcow:80 {
transparent
}
}
As the mailcow-nginx content is served by reverse proxy I changed the docker-compose file to not bind ports to the host and instead simply expose port 80.
```
expose: