Search code examples
linuxdebianhaproxyroundcubeiredmail

Can't log in to roundcube through HAProxy


For a school project we have to set up webmail. I chose for iRedMail. We have chosen for HAProxy as a loadbalancing service for our other sevices (webhosting, openvas, VPS). The loadbalancer sends the user to the right iRedMail server I created, but when I try to log in with an existing account (It works if I log in with that account directly on the iRedMail servers roundcube page itself without the loadbalancer) I can't log in and recieve the message: "Invalid request! No data was saved".

The HAProxy config file /etc/haproxy/haproxy.cfg has the following config:

frontend http
    bind 10.2.80.14:80
    mode http
    acl host_mail hdr(host) mail.8.transtcp.com
    use_backend mail if host_mail

backend mail
    balance roundrobin
    cookie SERVERID insert indirect nocache
    cookie JSESSIONID prefix nocache
    option forwardfor
    reqadd X-Forwarded-Proto:\ http
    server mail 192.168.20.9:443 check cookie s1 ssl verify none

As you can see cookies and forwarding http has been tried, but without succes. What haven't I done that is required?


Solution

  • Already got the answer: without a valid SSL certificate HAProxy can't reach the backend of roundcube. Adding a valid SSL certificate solved it.