After switching to Cloudflare and making the webmail website to a subdomain (webmail.XXXXXXX.XXX), SOGo redirects to https://127.0.0.1: PORTNUMBER/SOGo/so/ instead of https://webmail.XXXXXX.XXX/SOGo after logging in. I have checked mailcow.conf but I didn’t see anywhere where you can set the SOGo redirect. I can manually change the 127.0.0.1 to webmail.XXXXXX.XXX and it works.

  • chocolateimage likes this.
  • epikur-io I got it working by doing proxy_set_header Host $host then it worked. (I did set header to the response instead of to the proxy request as a mistake)

(manually change 127.0.0.1 to webmail.XXXX in the url bar)

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

5 months later
3 months later

Hi. I also encountered this problem with the SOGo login (master branch at 36b5cccd186090d726de62b6b00d1e842e67aacd).
I run the dockerized setup and caddy as a reverse proxy and updated the mailcow config accordingly.

HTTP_BIND=127.0.0.1
HTTP_PORT=8080
HTTPS_BIND=127.0.0.1
HTTPS_PORT=8443

When I try to log in to SOGo it redirects to the localhost and the internal TCP port
http://127.0.0.1:20000/SOGo/so/[mail-user]/Mail

I tried to add a port mapping to the SOGo container 127.0.0.1:20000:20000 and route incoming traffic directly from caddy to the SOGO container, without success.

Kind regards

Just an update from my side. I finally got it working. The problem could be resolved by modifying the caddy config.
Essentially just don’t pass the “Host” header to the upstream like header_up Host {upstream_hostport} and it’ll work. I think it’s related to this issue: mailcow/mailcow-dockerized5411

    2 months later

    epikur-io I got it working by doing proxy_set_header Host $host then it worked. (I did set header to the response instead of to the proxy request as a mistake)

    No one is typing