Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
KorvinSzanto opened this issue Oct 6, 2023 · 3 comments
Closed

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

KorvinSzanto opened this issue Oct 6, 2023 · 3 comments
Labels
upstream ⬆️ Relates to some dependency of this project

Comments

@KorvinSzanto
Copy link

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.

@francislavoie
Copy link
Member

You fork doesn't have allow. Does it work any better if you omit that from your config (i.e. is that actually the right CIDR to trust)?

I don't use AWS so I won't be able to debug this. We use https://github.com/mastercactapus/proxyprotocol. Apparently this is the same problem as mastercactapus/caddy2-proxyprotocol#8. /cc @mastercactapus if you have any ideas.

@KorvinSzanto
Copy link
Author

KorvinSzanto commented Oct 6, 2023

Does it work any better if you omit that from your config

Same behavior with the allow removed

That issue does sound like the same issue I'm facing

@francislavoie
Copy link
Member

This has apparently been fixed by the tlv branch. You can build Caddy with the fix, see mastercactapus/proxyprotocol#3 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream ⬆️ Relates to some dependency of this project
Projects
None yet
Development

No branches or pull requests

3 participants