# Colar em CT114 /root/traefik/dynamic.yml (após DNS financeiro + openpanel)
# Backend: VM123 10.10.10.123
# FOSSBilling na RAIZ de financeiro.ligbox.com.br (não usar /foss)

http:
  routers:
    financeiro-foss:
      rule: Host(`financeiro.ligbox.com.br`) && !PathPrefix(`/odoo`)
      priority: 10
      entryPoints: [websecure]
      tls:
        certResolver: letsencrypt
      service: vm123-foss
    financeiro-odoo:
      rule: Host(`financeiro.ligbox.com.br`) && PathPrefix(`/odoo`)
      entryPoints: [websecure]
      tls:
        certResolver: letsencrypt
      middlewares: [odoo-stripprefix, odoo-headers]
      service: vm123-odoo
    openpanel-user:
      rule: Host(`openpanel.ligbox.com.br`)
      entryPoints: [websecure]
      tls:
        certResolver: letsencrypt
      middlewares: [openpanel-headers]
      service: vm123-openpanel
    openpanel-admin:
      rule: Host(`admin.openpanel.ligbox.com.br`)
      entryPoints: [websecure]
      tls:
        certResolver: letsencrypt
      service: vm123-openadmin

  middlewares:
    odoo-stripprefix:
      stripPrefix:
        prefixes: [/odoo]
    odoo-headers:
      headers:
        customRequestHeaders:
          X-Forwarded-Proto: https
          X-Forwarded-Host: financeiro.ligbox.com.br
          X-Script-Name: /odoo
    openpanel-headers:
      headers:
        customRequestHeaders:
          X-Forwarded-Proto: https
          X-Forwarded-Host: openpanel.ligbox.com.br

  services:
    vm123-foss:
      loadBalancer:
        servers:
          - url: http://10.10.10.123:8092
    vm123-odoo:
      loadBalancer:
        servers:
          - url: http://10.10.10.123:8069
    vm123-openpanel:
      loadBalancer:
        servers:
          - url: http://10.10.10.123:2083
    vm123-openadmin:
      loadBalancer:
        servers:
          - url: http://10.10.10.123:2087
