# Upstream TLS
#
# Plain HTTP on the listener; TLS to the upstream. Set sni
# when the upstream expects a specific hostname for certificate
# validation (defaults to the request's Host header).
#
#   Client ──HTTP──► Praxis :8080 ──TLS──► Backend :8443
#
# Usage:
#   cargo run -p praxis-proxy -- -c examples/configs/protocols/upstream-tls.yaml
#   curl http://localhost:8080/

listeners:
  - name: default
    address: "127.0.0.1:8080"
    filter_chains:
      - main

filter_chains:
  - name: main
    filters:
      - filter: router
        routes:
          - path_prefix: "/"
            cluster: backend

      - filter: load_balancer
        clusters:
          - name: backend
            tls:
              sni: "api.example.com"
            endpoints:
              - "127.0.0.1:8443"

insecure_options:
  allow_private_endpoints: true # example proxies to local backends
