:8080 {
    redir / https://{host}{uri}
}

*, :8443 {
    gzip

    tls {%EMAIL%}

    redir 302 {
        if {path} is /
        / /webapp/
    }

    proxy /webapp/ kopano_webapp:80 {
        transparent
    }
    redir /webapp /webapp/

    proxy /Microsoft-Server-ActiveSync kopano_zpush:80 {
        transparent
    }

    proxy /ldap-admin/ ldap-admin:80 {
        without /ldap-admin
        transparent
    }
    redir /ldap-admin /ldap-admin/
}
