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

Handle scheme-less upstreams properly #9

Merged
merged 1 commit into from
Apr 1, 2020
Merged

Conversation

mohammed90
Copy link
Member

url.Parse returns an error if the argument is an IP address. The code previously didn't account for this. Now we check if there's scheme marker, and prefix the address with tcp:// if not. Some accommodation was necessary for the special case of unix socket addresses.

Fixes #8

… previously didn't account for this. Now we check if there's scheme marker, and prefix the address with `tcp://` if not. Some accommodation was necessary for the special case of unix socket addresses.
* If upstream doesn't have scheme explicitly specified as scheme://host, then
* assume it's tcp by prefixing it with tcp://. Later we check if the hostname is `unix:`.
* If so, then the arguemnt of fastcgi_pass was of the form `unix:/some/path`.
**/
Copy link
Member

Choose a reason for hiding this comment

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

Just curious, why the block style comment here? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Laziness 😂 didn't feel like double tapping the forward slash key

@mohammed90 mohammed90 merged commit 5698bf2 into master Apr 1, 2020
@mohammed90 mohammed90 deleted the fix-upstream-parse branch April 1, 2020 15:58
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

Successfully merging this pull request may close these issues.

Converting the nginx.conf panics
2 participants