{
    auto_https off
    admin off
}
:80 {
    route {
        @signup {
            method POST
            path /api/app/functions/addadmin /api/app/functions/usersignup /api/app/users /api/app/users/
        }
        respond @signup "Not available" 403
        handle_path /api/* {
            reverse_proxy sign-server:8080
        }
        @logo path_regexp logo ^/assets/logo-[A-Za-z0-9_-]+\.png$
        handle @logo {
            root * /srv/brand
            rewrite * /logo.jpg
            header Content-Type image/jpeg
            file_server
        }
        @brandjs file {
            root /srv/brand
            try_files {path}
        }
        handle @brandjs {
            root * /srv/brand
            file_server
        }
        handle /favicon.ico {
            root * /srv/brand
            file_server
        }
        handle /manifest.json {
            root * /srv/brand
            file_server
        }
        @spa not path /assets/* /static/* /locales/* /env.js /robots.txt /version.txt /sample_contacts.csv
        handle @spa {
            root * /srv/brand
            rewrite * /index.html
            file_server
        }
        reverse_proxy sign-web:3000
    }
}
