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

Throw "read: connection reset by peer" when I set "proxy_protocol v1" #268

Open
xiaoke1256 opened this issue Nov 12, 2024 · 3 comments
Open

Comments

@xiaoke1256
Copy link

Thank you for the wonderful product. However a error happened when I use it.
My caddyFile like this:

{
      layer4 {
                0.0.0.0:8883 {

                        @secure tls
                        route @secure {
                                tls {
                                }
                                proxy {
                                        proxy_protocol v1
                                        upstream 139.196.153.113:1883
                                }
                        }
                }
        }
}

the error log I received like this

"error": "writeto tcp 172.19.244.221:34178->139.196.153.113:1883: read tcp 172.19.244.221:34178->139.196.153.113:1883: read: connection reset by peer"

I must set 'proxy_protocol' to 'v1', because I want to get the remote real ip.

@vnxme
Copy link
Collaborator

vnxme commented Nov 12, 2024

@xiaoke1256 Are you sure the 139.196.153.113:1883 host understands and expects to receive proxy protocol? Is it a Caddy instance? Then please post its config. Otherwise it's unclear what could be wrong with the config you posted above.

@xiaoke1256
Copy link
Author

However when I delete the line proxy_protocol v1, it can work.

@vnxme
Copy link
Collaborator

vnxme commented Nov 14, 2024

So it might mean your upstream doesn't expect to receive proxy_protocol v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants