Skip to content

http_connect ​

http_connect is an HTTP CONNECT tunnel proxy, the kind used by HTTPS_PROXY settings.

yaml
server:
  tcp:
    middlewares:
      proxy:
        http_connect:
          users:
            alice: secret
          allowed_hosts:
            - "*.example.com"
            - api.github.com
          allowed_ports: [443]
          dial_timeout: 10s
    routers:
      proxy:
        entrypoints: [proxy]
        middlewares: [proxy]
FieldDefaultDescription
usersBasic auth users for Proxy-Authorization (user: password). When empty no authentication is required.
allowed_hostsallAllowed target hosts. *.example.com matches subdomains, * matches all.
allowed_portsallAllowed target ports.
dial_timeout10sTimeout to connect to the target.
timeout10sTimeout to read the CONNECT request.

Other methods get 405, failed authentication 407, disallowed targets 403 and unreachable targets 502. Use it behind tls_terminate to protect credentials, or with ip_allow_list.