Hello. Installed mailcow on host behind nginx proxy. Now I’m logging in via mail.mydomain.com . I see a login page with a login and password, and a button to go to SoGo (Webmail) I press on WebMail

I enter login / Password and an error occurs “Unhandled error response”
But I can safely go to the internal IP address. 172...2
nginx.conf
server {
listen 80;
server_name
mail.mydomain.com
www.mail.mydomain.com
;
location ^~ /.well-known/acme-challenge/ {
root /var/www/letsencrypt;
}
location / {
return 301 https://mail.mydomain.com$request_uri;
}
}
server {
listen 443 ssl;
server_name mail.mydomain.com;
ssl_certificate /etc/letsencrypt/live/mail.mydomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mail.mydomain.com/privkey.pem;
#return 200;
set_real_ip_from *.*.*.*;
real_ip_header X-Real-IP;
location / {
proxy_pass http://172.*.*.2;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_connect_timeout 100;
proxy_send_timeout 100;
proxy_read_timeout 100;
send_timeout 100;
}
}
SOGo log:
[60]: SOGoRootPage successful login from 'IP' for user 'Admin@mydomain.com' - expire = -1 grace = -1
But if on the login page mail.mydomain.com,

first log in with a login / password, and after that you press the button “Login to WebMail”

, then everything goes fine and works.