Mailcow-dockerized: Mailcow not working after update

Created on 26 Jan 2018  路  23Comments  路  Source: mailcow/mailcow-dockerized

Hello, toady I've update my mailcow server, and from this moment it's not working.
This is the error after docker-compose up -d.

WARNING: The LOG_LINES variable is not set. Defaulting to a blank string.
mailcowdockerized_mysql-mailcow_1 is up-to-date
mailcowdockerized_unbound-mailcow_1 is up-to-date
mailcowdockerized_dovecot-mailcow_1 is up-to-date
mailcowdockerized_dockerapi-mailcow_1 is up-to-date
mailcowdockerized_memcached-mailcow_1 is up-to-date
mailcowdockerized_redis-mailcow_1 is up-to-date
mailcowdockerized_watchdog-mailcow_1 is up-to-date
mailcowdockerized_ipv6nat_1 is up-to-date
Starting mailcowdockerized_postfix-mailcow_1 ... 
mailcowdockerized_clamd-mailcow_1 is up-to-date
mailcowdockerized_sogo-mailcow_1 is up-to-date
mailcowdockerized_php-fpm-mailcow_1 is up-to-date
mailcowdockerized_nginx-mailcow_1 is up-to-date
mailcowdockerized_acme-mailcow_1 is up-to-date
Starting mailcowdockerized_postfix-mailcow_1 ... error

ERROR: for mailcowdockerized_postfix-mailcow_1  Cannot start service postfix-mailcow: driver failed programming external connectivity on endpoint mailcowdockerized_postfix-mailcow_1 (c8d07bb3a850bc843378b655f817c7f4e8e894686c8409007352b4fb7e2d67b7): Error starting userland proxy: listen tcp 0.0.0.0:25: bind: address already in use

ERROR: for postfix-mailcow  Cannot start service postfix-mailcow: driver failed programming external connectivity on endpoint mailcowdockerized_postfix-mailcow_1 (c8d07bb3a850bc843378b655f817c7f4e8e894686c8409007352b4fb7e2d67b7): Error starting userland proxy: listen tcp 0.0.0.0:25: bind: address already in use
ERROR: Encountered errors while bringing up the project.

All 23 comments

Please update by using update.sh

But anyways... some other software blocks on port 25. A local Exim or Postfix?

After update.sh is this:

ERROR: for postfix-mailcow  Cannot start service postfix-mailcow: driver failed programming external connectivity on endpoint mailcowdockerized_postfix-mailcow_1 (4f9634854785deea6dee5b168c2661ae9917fb33ee219710b693c87d15a72e33): Error starting userland proxy: listen tcp 0.0.0.0:25: bind: address already in use
ERROR: Encountered errors while bringing up the project.
Collecting garbage...
Further cleanup...
If you want to cleanup further garbage collected by Docker, please make sure all containers are up and running before cleaning your system by executing "docker system prune"

Yes, because there is still something blocking port 25: listen tcp 0.0.0.0:25: bind: address already in use

have you tried turning it off and on again?

the whole pc i mean, a full reboot

@andryyy After current update it says wrong password for my mail boxes when trying to log in via Thunderbird or SOGo. What's going on? =(

@andryyy Oh great, it looks like Fail2Ban is banning my IP o_O... It says rule id 5. Why?

EDIT: Currently it only says 9 more attempts until ban, though. So I guess it really has to do with failed login attempts. How come the password is wrong now, though?

EDIT2: The PW is 100% correct, though, because I didn't change it in Thunderbird and Thunderbird keeps saying wrong password. Copypaste from KeePass also doesn't work in SOGo.

@andryyy I saw that some files were chowned by root in my mailcow dockerized folder, so I chowned everything back to myself and restarted. Now I can login.
Any idea which files could cause such an issue when chowned by the wrong user?

The umask is more important than the actual user. You shouldn鈥檛 change the owners or file mods anyway. :-/ I guess this was related to the fixed update script.

@andryyy I keep mailcow in my user home folder, so I always had it on user:user. Was that wrong? 鈽癸笍 I don't think I changed anything umask related, I just ran update.sh as root once by mistake I think.

No, it should be fine as long as the umask is 0022 :-) So rw-r-r for files, rwx-rx-rx for directories. 馃憤
Let me know if you run into problems again, I check it remote, then. :-)

After update some findings in the UX of the backend:

  • when logged in ad admin and click on the debug menu, I only see RSPAM screen. Normally there was also a container overview and a 3rd screen I can't recall.

  • when I click via configuration>mailboxes all the additional menu items are missing except domains.

  • In the domain screen there seems to be someting wrong with the quota calculations. They do not match with the actual size of the folders, or when logged as mailbox user showing a far less number then the admin page showing.

Not related to the update... these things work fine. The quota was not changed in any way, you probably imported or copied files to the maildir?
Check your dev console, please. PHP and Nginx logs would be useful, too.

@andryyy I had some problems on another server with SOGo; I think I just did a mistake of running update.sh without sudo on these two servers. Keeping the conf and fresh cloning of the repo did the trick. 馃憤
Thank you for your support 馃樃.

I updated Mailcow-dockerized with update. sh to commit 1610 (MASTER). Now I can no longer access a login (admin).

with docker logs mailcowdockerized_nginx-mailcow_1 I got the following output:

2018/01/27 17:42:25 [emerg] 9#9: a duplicate default server for 0.0.0.0:80 in /etc/nginx/conf.d/site.conf:25
nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/conf.d/site.conf:25
nginx: configuration file /etc/nginx/nginx.conf test failed
2018/01/27 17:42:31 [emerg] 8#8: a duplicate default server for 0.0.0.0:80 in /etc/nginx/conf.d/site.conf:25
nginx: [emerg] a duplicate default server for 0.0.0.0:80 in /etc/nginx/conf.d/site.conf:25
nginx: configuration file /etc/nginx/nginx.conf test failed

netstat -ano

Aktive Internetverbindungen (Server und stehende Verbindungen)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       Timer
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 0.0.0.0:42961           0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 0.0.0.0:38833           0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 0.0.0.0:58997           0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 127.0.0.1:19991         0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 0.0.0.0:46237           0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 0.0.0.0:2049            0.0.0.0:*               LISTEN      aus (0.00/0/0)
tcp        0      0 172.22.1.1:52548        172.22.1.249:6379       VERBUNDEN   aus (0.00/0/0)
tcp        0      0 172.22.1.1:52550        172.22.1.249:6379       VERBUNDEN   aus (0.00/0/0)
tcp        0    272 192.168.10.5:22         10.180.157.6:18679      VERBUNDEN   ein (0,29/0/0)
tcp        0      0 192.168.10.5:723        192.168.10.89:2049      VERBUNDEN   keepalive (1,72/0/0)
tcp6       0      0 :::143                  :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::111                  :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::465                  :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::39987                :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::22                   :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::25                   :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::4190                 :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::993                  :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::2049                 :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::995                  :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::54147                :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::587                  :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::40077                :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::58413                :::*                    LISTEN      aus (0.00/0/0)
tcp6       0      0 :::110                  :::*                    LISTEN      aus (0.00/0/0)
udp        0      0 0.0.0.0:50038           0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:37872           0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:58619           0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:40811           0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:2049            0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:51220           0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:111             0.0.0.0:*                           aus (0.00/0/0)
udp        0      0 0.0.0.0:835             0.0.0.0:*                           aus (0.00/0/0)
udp6       0      0 :::60239                :::*                                aus (0.00/0/0)
udp6       0      0 :::56247                :::*                                aus (0.00/0/0)
udp6       0      0 :::5353                 :::*                                aus (0.00/0/0)
udp6       0      0 :::48434                :::*                                aus (0.00/0/0)
udp6       0      0 :::57290                :::*                                aus (0.00/0/0)
udp6       0      0 :::2049                 :::*                                aus (0.00/0/0)
udp6       0      0 :::111                  :::*                                aus (0.00/0/0)
udp6       0      0 :::49269                :::*                                aus (0.00/0/0)
udp6       0      0 :::835                  :::*                                aus (0.00/0/0)
raw6       0      0 :::58                   :::*                    7           aus (0.00/0/0)

@roswitina Did you run update.sh as root/sudo ?

I've always worked as root before.

Current master is https://github.com/mailcow/mailcow-dockerized/commit/1f08e9a7b73d00f65d28c211450cdadd85074c4e and not 1610.

What is your current site.conf? Did you modify it? Seems like you have 2 server blocks in it

Also better not hijacking issues...

Can you post your site.conf please?

from /data/conf/nginx/site.conf

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  include /etc/nginx/conf.d/server_name.active;
  return 301 https://$host$request_uri;
}
upstream portainer {
  server portainer-mailcow:9000;
}

map $http_upgrade $connection_upgrade {
  default upgrade;
  '' close;
}
server_tokens off;
proxy_cache_path /tmp levels=1:2 keys_zone=sogo:10m inactive=24h  max_size=1g;
server_names_hash_bucket_size 64;

map $http_x_forwarded_proto $client_req_scheme {
     default $scheme;
     https https;
}

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  include /etc/nginx/conf.d/server_name.active;
  return 301 https://$host$request_uri;
}

server {
  include /etc/nginx/mime.types;
  charset utf-8;
  override_charset on;

  add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  add_header X-Content-Type-Options nosniff;
  add_header X-XSS-Protection "1; mode=block";
  add_header X-Robots-Tag none;
  add_header X-Download-Options noopen;
  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-Permitted-Cross-Domain-Policies none;

  index index.php index.html;

  include /etc/nginx/conf.d/listen_plain.active;
  include /etc/nginx/conf.d/server_name.active;

  error_log  /var/log/nginx/error.log;
  access_log /var/log/nginx/access.log;
  absolute_redirect off;
  root /web;

  location ~ ^/api/v1/(.*)$ {
    try_files $uri $uri/ /json_api.php?query=$1;
  }

  location ^~ /.well-known/acme-challenge/ {
    allow all;
    default_type "text/plain";
  }

  # If behind reverse proxy, forwards the correct IP
  set_real_ip_from 10.0.0.0/8;
  set_real_ip_from 172.16.0.0/12;
  set_real_ip_from 192.168.0.0/16;
  set_real_ip_from fd00::/8;
  real_ip_header X-Forwarded-For;
  real_ip_recursive on;

  rewrite ^/.well-known/caldav$ /SOGo/dav/ permanent;
  rewrite ^/.well-known/carddav$ /SOGo/dav/ permanent;

  location ^~ /principals {
        return 301 /SOGo/dav;
  }

  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    fastcgi_index index.php;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param PHP_VALUE "max_execution_time = 1200
                             max_input_time = 1200
                             memory_limit = 64M";
    fastcgi_read_timeout 1200;
  }

  location /rspamd/ {
    proxy_pass       http://rspamd:11334/;
    proxy_set_header Host      $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;
  }

  location ~* ^/Autodiscover/Autodiscover.xml {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files /autodiscover.php =404;
  }

  location ~* ^/Autodiscover/Autodiscover.json {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files /autodiscover-json.php =404;
  }

  location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files /autoconfig.php =404;
  }

  location ^~ /Microsoft-Server-ActiveSync {
    proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync;
    proxy_connect_timeout 1000;
    proxy_next_upstream timeout error;
    proxy_send_timeout 1000;
    proxy_read_timeout 1000;
    proxy_buffer_size 8k;
    proxy_buffers 4 32k;
    proxy_temp_file_write_size 64k;
    proxy_busy_buffers_size 64k;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header x-webobjects-server-protocol HTTP/1.0;
    proxy_set_header x-webobjects-remote-host $remote_addr;
    proxy_set_header x-webobjects-server-name $server_name;
    proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
    proxy_set_header x-webobjects-server-port $server_port;
    client_body_buffer_size 128k;
    client_max_body_size 0;
  }

  location ^~ /SOGo {
    proxy_pass http://sogo:20000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header x-webobjects-server-protocol HTTP/1.0;
    proxy_set_header x-webobjects-remote-host $remote_addr;
    proxy_set_header x-webobjects-server-name $server_name;
    proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
    proxy_set_header x-webobjects-server-port $server_port;
    client_body_buffer_size 128k;
    client_max_body_size 0;
    break;
  }

  location /SOGo.woa/WebServerResources/ {
    proxy_pass http://sogo:9192/WebServerResources/;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    allow all;
  }

  location /.woa/WebServerResources/ {
    proxy_pass http://sogo:9192/WebServerResources/;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    allow all;
  }

  location /SOGo/WebServerResources/ {
    proxy_pass http://sogo:9192/WebServerResources/;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    allow all;
  }

  location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$ {
    proxy_pass http://sogo:9192/$1.SOGo/Resources/$2;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
  }

  include /etc/nginx/conf.d/site.*.custom;
}

server {
  include /etc/nginx/mime.types;
  charset utf-8;
  override_charset on;

  ssl on;
  ssl_certificate /etc/ssl/mail/cert.pem;
  ssl_certificate_key /etc/ssl/mail/key.pem;
  ssl_protocols TLSv1.2;
  ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:SSL:50m;
  ssl_session_timeout 1d;
  ssl_session_tickets off;

  add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  add_header X-Content-Type-Options nosniff;
  add_header X-XSS-Protection "1; mode=block";
  add_header X-Robots-Tag none;
  add_header X-Download-Options noopen;
  add_header X-Frame-Options "SAMEORIGIN";
  add_header X-Permitted-Cross-Domain-Policies none;

  index index.php index.html;

  include /etc/nginx/conf.d/listen_ssl.active;
  include /etc/nginx/conf.d/server_name.active;

  error_log  /var/log/nginx/error.log;
  access_log /var/log/nginx/access.log;
  absolute_redirect off;
  root /web;

  location /portainer/ {
    proxy_http_version 1.1;
    proxy_set_header Host              $http_host;   # required for docker client's sake
    proxy_set_header X-Real-IP         $remote_addr; # pass on real client's IP
    proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_read_timeout                 900;

    proxy_set_header Connection "";
    proxy_buffers 32 4k;
    proxy_pass http://portainer/;
  }

  location /portainer/api/websocket/ {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_pass http://portainer/api/websocket/;
  }

  location ~ ^/api/v1/(.*)$ {
    try_files $uri $uri/ /json_api.php?query=$1;
  }

  location ^~ /.well-known/acme-challenge/ {
    allow all;
    default_type "text/plain";
  }

  # If behind reverse proxy, forwards the correct IP
  set_real_ip_from 10.0.0.0/8;
  set_real_ip_from 172.16.0.0/12;
  set_real_ip_from 192.168.0.0/16;
  set_real_ip_from fd00::/8;
  real_ip_header X-Forwarded-For;
  real_ip_recursive on;

  rewrite ^/.well-known/caldav$ /SOGo/dav/ permanent;
  rewrite ^/.well-known/carddav$ /SOGo/dav/ permanent;

  location ^~ /principals {
    return 301 /SOGo/dav;
  }

  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    fastcgi_index index.php;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param PATH_INFO $fastcgi_path_info;
    fastcgi_param PHP_VALUE "max_execution_time = 1200
                             max_input_time = 1200
                             memory_limit = 64M";
    fastcgi_read_timeout 1200;
  }

  location /rspamd/ {
    proxy_pass       http://rspamd:11334/;
    proxy_set_header Host      $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_redirect off;
  }

  location ~* ^/Autodiscover/Autodiscover.xml {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files /autodiscover.php =404;
  }

  location ~* ^/Autodiscover/Autodiscover.json {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files /autodiscover-json.php =404;
  }

  location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass phpfpm:9000;
    include /etc/nginx/fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    try_files /autoconfig.php =404;
  }

  location ^~ /Microsoft-Server-ActiveSync {
    proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync;
    proxy_connect_timeout 1000;
    proxy_next_upstream timeout error;
    proxy_send_timeout 1000;
    proxy_read_timeout 1000;
    proxy_buffer_size 8k;
    proxy_buffers 4 32k;
    proxy_temp_file_write_size 64k;
    proxy_busy_buffers_size 64k;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header x-webobjects-server-protocol HTTP/1.0;
    proxy_set_header x-webobjects-remote-host $remote_addr;
    proxy_set_header x-webobjects-server-name $server_name;
    proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
    proxy_set_header x-webobjects-server-port $server_port;
    client_body_buffer_size 128k;
    client_max_body_size 0;
  }

  location ^~ /SOGo {
    proxy_pass http://sogo:20000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header x-webobjects-server-protocol HTTP/1.0;
    proxy_set_header x-webobjects-remote-host $remote_addr;
    proxy_set_header x-webobjects-server-name $server_name;
    proxy_set_header x-webobjects-server-url $client_req_scheme://$http_host;
    proxy_set_header x-webobjects-server-port $server_port;
    client_body_buffer_size 128k;
    client_max_body_size 0;
    break;
  }

  location /SOGo.woa/WebServerResources/ {
    proxy_pass http://sogo:9192/WebServerResources/;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    allow all;
  }

  location /.woa/WebServerResources/ {
    proxy_pass http://sogo:9192/WebServerResources/;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    allow all;
  }

  location /SOGo/WebServerResources/ {
    proxy_pass http://sogo:9192/WebServerResources/;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/WebServerResources/;
    allow all;
  }

  location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$ {
    proxy_pass http://sogo:9192/$1.SOGo/Resources/$2;
    proxy_set_header Host $http_host;
    proxy_cache sogo;
    proxy_cache_valid 200 1d;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    #alias /usr/lib/GNUstep/SOGo/$1.SOGo/Resources/$2;
  }

  include /etc/nginx/conf.d/site.*.custom;
}

I already activated portainer 2 months ago after this tutorial:
https://mailcow.github.io/mailcow-dockerized-docs/third_party-portainer/

You have this portion twice:

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  include /etc/nginx/conf.d/server_name.active;
  return 301 https://$host$request_uri;
}

Maybe that could be a problem.

Seems you have the following block in your config twice:

server {
listen 80 default_server;
listen [::]:80 default_server;
include /etc/nginx/conf.d/server_name.active;
return 301 https://$host$request_uri;
}

Comment it with #/remove it and start the container again with docker-compose up -d nginx-mailcow

That's probably it. Thanks.

Damnit, I fell for this today on one of my instances myself 馃惐
Make sure to always put this at the very top!

@andryyy By the way: Maybe we should make an env variable so this portion is added to the site.conf by script? Maybe something like: FORCE_HTTPS = true/false ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

K2rool picture K2rool  路  3Comments

damdinsharav picture damdinsharav  路  3Comments

constin picture constin  路  3Comments

poldixd picture poldixd  路  3Comments

Braintelligence picture Braintelligence  路  3Comments