Skip to content

Building 70 Projects ranging from beginner to advanced so anyone can β€” learn from, build upon, use as a reference, or even copy directly. Owned by my cybersecurity company πŸ‘‡

911 B
Raw Blame
version: 1

# HTTPS with SNI (multiple certificates for different domains)
listen:
  - port: 8080  # HTTP with redirect
    redirect_https: true

  - port: 8443  # HTTPS with SNI
    tls:
      sni:
        - domain: "api.localhost"
          cert: examples/certs/api.localhost.crt
          key: examples/certs/api.localhost.key
        - domain: "web.localhost"
          cert: examples/certs/web.localhost.crt
          key: examples/certs/web.localhost.key
      default_cert: examples/certs/default.crt
      default_key: examples/certs/default.key

upstreams:
  - name: api-backend
    servers:
      - host: "127.0.0.1:8001"
        weight: 1

  - name: web-backend
    servers:
      - host: "127.0.0.1:8002"
        weight: 1

routes:
  - host: "api.localhost"
    paths:
      - path: /
        upstream: api-backend

  - host: "web.localhost"
    paths:
      - path: /
        upstream: web-backend