Hi guys, I’m new to the forums and new to all the sysadmin stuff as a whole. I recently managed to get a decently priced rootserver from Hetzner. I’ve managed to setup certbox, nginx, vhosts and all the other stuff I need day in and out.
The one thing that is still missing, though is mail. I’ve created all configs according to the docs and I’m trying to set nginx as a reverse proxy to forward requests to mailcow in my docker container. Dockerized-mailcow is running fine, but I can’t get it working with nginx. Here’s what I’ve got so far. If I run docker ps
I get this:
956da90382a1 robbertkl/ipv6nat "/docker-ipv6nat-com…" 6 hours ago Up 5 hours mailcowdockerized-ipv6nat-mailcow-1
dd52addd92d7 mailcow/watchdog:2.03 "/bin/sh -c /watchdo…" 6 hours ago Up 5 hours mailcowdockerized-watchdog-mailcow-1
640d63b434c7 mailcow/acme:1.88 "/sbin/tini -g -- /s…" 6 hours ago Up 5 hours mailcowdockerized-acme-mailcow-1
edfe78e4b52d mailcow/rspamd:1.96 "/docker-entrypoint.…" 6 hours ago Up 5 hours mailcowdockerized-rspamd-mailcow-1
4859eff042a7 mcuadros/ofelia:latest "/usr/bin/ofelia dae…" 6 hours ago Up 5 hours mailcowdockerized-ofelia-mailcow-1
e8d3b0aa74c3 nginx:mainline-alpine "/docker-entrypoint.…" 6 hours ago Up 5 hours 127.0.0.1:8080->8080/tcp, 80/tcp, 127.0.0.1:8443->8443/tcp mailcowdockerized-nginx-mailcow-1
554502d5c998 mailcow/dovecot:1.30 "/docker-entrypoint.…" 6 hours ago Up 5 hours 0.0.0.0:110->110/tcp, :::110->110/tcp, 0.0.0.0:143->143/tcp, :::143->143/tcp, 0.0.0.0:993->993/tcp, :::993->993/tcp, 0.0.0.0:995->995/tcp, :::995->995/tcp, 0.0.0.0:4190->4190/tcp, :::4190->4190/tcp, 127.0.0.1:19991->12345/tcp mailcowdockerized-dovecot-mailcow-1
2eaa1cbf65ad mailcow/postfix:1.75 "/docker-entrypoint.…" 6 hours ago Up 5 hours 0.0.0.0:25->25/tcp, :::25->25/tcp, 0.0.0.0:465->465/tcp, :::465->465/tcp, 0.0.0.0:587->587/tcp, :::587->587/tcp, 588/tcp mailcowdockerized-postfix-mailcow-1
9ee990514272 mailcow/phpfpm:1.88 "/docker-entrypoint.…" 6 hours ago Up 5 hours 9000/tcp mailcowdockerized-php-fpm-mailcow-1
48593cace2bc mailcow/solr:1.8.3 "docker-entrypoint.s…" 6 hours ago Up 5 hours 127.0.0.1:18983->8983/tcp mailcowdockerized-solr-mailcow-1
a725611279d4 mariadb:10.5 "docker-entrypoint.s…" 6 hours ago Up 5 hours 127.0.0.1:13306->3306/tcp mailcowdockerized-mysql-mailcow-1
9b27293af1d4 mailcow/clamd:1.66 "/sbin/tini -g -- /c…" 6 hours ago Up 5 hours (healthy) mailcowdockerized-clamd-mailcow-1
c4fa12e828b5 redis:7-alpine "docker-entrypoint.s…" 6 hours ago Up 5 hours 127.0.0.1:7654->6379/tcp mailcowdockerized-redis-mailcow-1
648fd4132137 mailcow/sogo:1.123 "/docker-entrypoint.…" 6 hours ago Up 5 hours mailcowdockerized-sogo-mailcow-1
4d7f0052b373 mailcow/dockerapi:2.08 "/bin/sh /app/docker…" 6 hours ago Up 5 hours mailcowdockerized-dockerapi-mailcow-1
4698e0bf3fb7 mvance/unbound:latest "/unbound.sh" 6 hours ago Up 5 hours (healthy) 53/tcp, 53/udp mailcowdockerized-unbound-mailcow-1
3406a54e2618 memcached:alpine "docker-entrypoint.s…" 6 hours ago Up 5 hours 11211/tcp mailcowdockerized-memcached-mailcow-1
116e37ef45f0 mailcow/netfilter:1.59 "/bin/sh -c /app/doc…" 6 hours ago Up 5 hours mailcowdockerized-netfilter-mailcow-1
4157a098a6ed mailcow/olefy:1.13 "python3 -u /app/ole…" 6 hours ago Up 5 hours mailcowdockerized-olefy-mailcow-1
Also when I ran docker-compose up -d
, I didn’t get any exceptions, so I think this should be okay. My nginx vhost lools like this:
server {
listen 80;
listen [::]:80;
server_name mail.rheno-palatia.eu autodiscover.* autoconfig.*;
access_log /var/log/nginx/mail/mail.access.log;
error_log /var/log/nginx/mail/mail.error.log debug;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
include /etc/letsencrypt/options-ssl-nginx.conf;
server_tokens off;
server_name mail.rheno-palatia.eu autodiscover.* autoconfig.*;
ssl_certificate /etc/letsencrypt/live/mail.rheno-palatia.eu/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.rheno-palatia.eu/privkey.pem;
location /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:8443/Microsoft-Server-ActiveSync;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 75;
proxy_send_timeout 3650;
proxy_read_timeout 3650;
proxy_buffers 64 512k; # Needed since the 2022-04 Update for SOGo
client_body_buffer_size 512k;
client_max_body_size 0;
}
location / {
proxy_pass http://127.0.0.1:8443/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
# The following Proxy Buffers has to be set if you want to use SOGo after the 2022-04 (April 2022) Update
# Otherwise a Login will fail like this: https://github.com/mailcow/mailcow-dockerized/issues/4537
proxy_buffer_size 128k;
proxy_buffers 64 512k;
proxy_busy_buffers_size 512k;
}
}
So from my understanding, mailcow should be available under mail.rheno-palatia.eu
. If I try to access the site, however I get a 400 Bad request. Unfortunately I can’t debug this any further, as I get absolutely zero output to my logfiles. Neiter /var/log/ nginx/mail/mail.error.log
has any content, nor does the global nginx error logfile in /var/log/nginx/nginx.error.log
.
Sooo yea. I’m all out of ideas as how to handle this. Can anyone help me with this?
Kind regards,
Chris