Skip to content

Built in proxy protocol doesn't work with AWS load balancer #5863

@KorvinSzanto

Description

@KorvinSzanto

I'm trying to migrate away from pires/go-proxyproto to the newly embedded proxyprotocol in caddy but I'm having a hard time getting things working with proxy protocol enabled AWS load balancers.
My config looks like this:

{
    debug
    servers {
        listener_wrappers {
            proxy_protocol {
                    timeout 2s
                    allow 192.168.86.1/24
            }
            tls
        }
    }
}



caddytest.mydomain.com:443 {
    reverse_proxy https://127.0.0.1:8443 {
        transport http {
            tls_insecure_skip_verify
        }
    }
}

And attempting to access caddy through the LB outputs:

2023/10/06 16:58:04.254	DEBUG	http.stdlib	http: TLS handshake error from 192.168.86.42:5943: invalid length

and gives me ERR_CONNECTION_CLOSED in the browser.
If I use my fork of rocketreferrals/caddy-go-proxyproto things work as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream ⬆️Relates to some dependency of this project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions