{
    auto_https disable_redirects

    log {
        output stderr
        format console
        level info
    }

    servers {
        protocols h1 h2
    }
}

app.hotpocket.work.bthlabs.net:8000 {
    tls /opt/tls/app.hotpocket.work.bthlabs.net.crt /opt/tls/app.hotpocket.work.bthlabs.net.key

    log {
        output stderr
        format console
        level info
    }

    reverse_proxy http://backend-webapp.hotpocket.work.bthlabs.net:8000 {
        transport http {
            versions h1_1
        }

        header_down +X-HotPocket-Backend "backend-webapp"
        header_up X-Forwarded-Proto {scheme}
        header_up X-Forwarded-For {remote_host}
    }
}

admin.hotpocket.work.bthlabs.net:8000 {
    tls /opt/tls/app.hotpocket.work.bthlabs.net.crt /opt/tls/app.hotpocket.work.bthlabs.net.key

    log {
        output stderr
        format console
        level info
    }

    reverse_proxy http://backend-admin.hotpocket.work.bthlabs.net:8000 {
        transport http {
            versions h1_1
        }

        header_down +X-HotPocket-Backend "backend-admin"
        header_up X-Forwarded-Proto {scheme}
        header_up X-Forwarded-For {remote_host}
    }
}
