V2: rainloop breaks with Caddy v2

I use Rainloop as my webmail frontend on my debian 10 amd64 machine and with Caddy v1 and the following setup/config:

$ tree -L 2 /etc/caddy/html/rl
├── data
│   ├── _data_
│   ├── EMPTY
│   ├── index.html
│   ├── index.php
│   ├── SALT.php
│   └── VERSION
├── index.php
└── rainloop
    └── v

4 directories, 7 files

https://mail.hnrk.io {
                tls /etc/caddy/hnrk.io.crt /etc/caddy/hnrk.io.key
                gzip {
                        ext *
                        level 4
                fastcgi / unix:/run/php/php7.3-fpm.sock php {
                        root /etc/caddy/html/rl
                header / {
                        Strict-Transport-Security "max-age=31536000; includeSubdomains; preload"
                        X-XSS-Protection "1; mode=block;"
                        X-Content-Type-Options "nosniff"
                        X-Frame-Options "SAMEORIGIN"
                limits {
                        header 64kb
                        body 8gb
                timeouts {
                        read   5s
                        header 5s
                        write  0
                        idle   20s
                root /etc/caddy/html/rl
                internal /data
                ext .html .htm .php
                log / /etc/caddy/logs/access.log
                errors /etc/caddy/logs/error.log

it works just fine, no errors:

When I run Caddy v2 instead with the same setup and the following config:

mail.hnrk.io {
        root * /etc/caddy/html/rl
        tls /etc/caddy/hnrk.io.crt /etc/caddy/hnrk.io.key
        encode brotli zstd gzip
        php_fastcgi unix//run/php/php7.3-fpm.sock
        file_server * {
                hide /data

Rainloop shows a blank white page and that is what the brave console says:

Do you have any idea why that is and if this actually has something to do with Caddy v2 mime type stuff?

Thanks! :smile:

UPDATE: Even with Caddy v2 beta 8, rainloop does not work properly… With v1, it does however.

@matt Maybe you have an idea? Seems to be a MIME related issue… Thanks! :slight_smile:

What are the response headers of the requests that are breaking?

I’ve had a closer look and it seems that rainloop, although a stylesheet is requested, sends an html document instead with Caddy v2:

Headers from Caddy v2 for the asset that breaks


With Caddy v1, the site loads and gets the proper assets:

Headers from Caddy v1 for the asset that breaks in v2 but works fine in v1:


Could it be that Caddy does somehow manipulate some files MIME types?