:80 {
    encode gzip zstd

    handle_path /* {
        root * /usr/share/caddy
        file_server
        try_files {path} /
    }

    handle_path /media/* {
        root * /media
        file_server
    }

    handle /api* {
        reverse_proxy webpreview-api:8000
    }

    handle /ws* {
        reverse_proxy webpreview-api:8000
    }
}
