{
    admin unix//config/admin.sock
    servers {
        protocols h1 h2
    }
}
(headers) {
    encode zstd gzip
    header {
        -Server
        X-Content-Type-Options nosniff
        ?Referrer-Policy same-origin
        Strict-Transport-Security "max-age=2592000"
    }
}
trillax.tech {
    import headers
    header X-Frame-Options DENY
    @commercial not path /licenses /licenses/*
    header @commercial Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self'; connect-src 'self'; object-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'self'"
    header Permissions-Policy "camera=(), microphone=(), geolocation=()"
    @publicapi path /api/access /api/demo
    handle @publicapi {
        request_body {
            max_size 4KB
        }
        reverse_proxy 127.0.0.1:18174 {
            header_up Host trillax.tech
            header_up X-Forwarded-Host trillax.tech
            header_up X-Forwarded-Proto https
            header_up X-Forwarded-For {remote_host}
            transport http {
                read_timeout 15s
            }
        }
    }
    handle {
        header Cache-Control "no-cache"
        root * /srv/public
        file_server
    }
}
www.trillax.tech {
    import headers
    redir https://trillax.tech{uri} 308
}
app.trillax.tech {
    import headers
    header ?X-Frame-Options SAMEORIGIN
    request_body {
        max_size 16MB
    }
    @database path /web/database /web/database/*
    respond @database "Not found" 404
    @signup path /web/signup /web/reset_password
    respond @signup "Not found" 404
    @old path /molino /molino/*
    redir @old /odoo 302
    @oldapi path /api /api/*
    respond @oldapi "El servicio anterior fue retirado" 410
    reverse_proxy 127.0.0.1:18172 {
        header_up Host app.trillax.tech
        header_up X-Forwarded-Host app.trillax.tech
        header_up X-Forwarded-Proto https
        header_up X-Forwarded-For {remote_host}
        transport http {
            read_timeout 180s
        }
    }
}
gestion.trillax.tech {
    import headers
    header X-Frame-Options DENY
    request_body {
        max_size 4KB
    }
    reverse_proxy 127.0.0.1:18174 {
        header_up Host gestion.trillax.tech
        header_up X-Forwarded-Host gestion.trillax.tech
        header_up X-Forwarded-Proto https
        header_up X-Forwarded-For {remote_host}
    }
}
srv2070168.hstgr.cloud {
    import headers
    redir https://app.trillax.tech/odoo 302
}
gestion.srv2070168.hstgr.cloud {
    import headers
    redir https://gestion.trillax.tech/ 302
}

# BEGIN MANAGED TENANTS
demo-alta.app.trillax.tech {
 import headers
 header ?X-Frame-Options SAMEORIGIN
 request_body {
  max_size 16MB
 }
 @database path /web/database /web/database/*
 respond @database 404
 @signup path /web/signup /web/reset_password
 respond @signup 404
 reverse_proxy 127.0.0.1:18180 {
  header_up Host demo-alta.app.trillax.tech
  header_up X-Forwarded-Host demo-alta.app.trillax.tech
  header_up X-Forwarded-Proto https
  header_up X-Forwarded-For {remote_host}
  transport http {
   read_timeout 180s
  }
 }
}
