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

reverseproxy: Keep path to unix socket as dial address #4232

Merged
merged 2 commits into from
Jul 7, 2021

Conversation

elnoro
Copy link
Contributor

@elnoro elnoro commented Jul 5, 2021

Hello,

This is a fix for #4231. I tried changing the Path variable in different ways but it did not help.

It seems http transport relies on the address in the dial info context var which caused the issue (https://github.com/caddyserver/caddy/blob/master/modules/caddyhttp/reverseproxy/httptransport.go#L181).

I have also added a test for healthchecks to reproduce the bug described in the issue.

@CLAassistant
Copy link

CLAassistant commented Jul 5, 2021

CLA assistant check
All committers have signed the CLA.

@francislavoie
Copy link
Member

@ctsrc could you please try out this fix to confirm that it solves the problem for you?

You'll need to build Caddy from source. Clone the repo and checkout this branch elnoro-fix4321 and then run:

$ cd cmd/caddy/
$ go build

If you need plugins, you can add them in cmd/caddy/main.go as imports in there.

Thanks!

@francislavoie francislavoie added bug 🐞 Something isn't working under review 🧐 Review is pending before merging labels Jul 5, 2021
@francislavoie francislavoie added this to the v2.4.4 milestone Jul 5, 2021
@ctsrc
Copy link

ctsrc commented Jul 5, 2021

@francislavoie I will try it later today and let you know

Copy link
Member

@mohammed90 mohammed90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! This fix is more consistent with the documentation comment on the Address field of DialInfo than before. It says the field follows the same semantics of the address parameter of net.Dial, which in turn expects path on the filesystem for Unix sockets.

@ctsrc
Copy link

ctsrc commented Jul 6, 2021

@francislavoie I tested it now and this fix by @elnoro solves the problem for me 👍🏻

@elnoro thank you very much for fixing this problem 😊

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a subtle difference, appreciate the change.

@francislavoie francislavoie changed the title reverseproxy: keep path to socket as dial address (fix #4231) reverseproxy: Keep path to unix socket as dial address Jul 7, 2021
@francislavoie francislavoie merged commit d882211 into caddyserver:master Jul 7, 2021
@francislavoie francislavoie removed the under review 🧐 Review is pending before merging label Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants