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

adding in some proxyification adjustments #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

adding in some proxyification adjustments #13

wants to merge 4 commits into from

Conversation

nshttpd
Copy link

@nshttpd nshttpd commented Jun 11, 2017

Some services cough jenkins cough build redirects based on the Host: header sent in the request. If the 'to' definition is an externally not resolvable hostname then these 302's break usage. So if the Host: header needs to be the same all the way through, set the value to true and the resulting backend request will have the Host header set.

underpants.go Outdated
@@ -98,6 +98,10 @@ type conf struct {
// A special group, `*`, may be specified which allows any authenticated
// user.
AllowedGroups []string `json:"allowed-groups"`

// Fix the host header on the requst to the backend proxied service to match
Copy link

@dragonsinth dragonsinth Jun 14, 2017

Choose a reason for hiding this comment

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

s/requst/request (found by @jhump)

underpants.go Outdated
proto = "https"
}

if r.Header.Get("X-Forwarded-Proto") != "" {

Choose a reason for hiding this comment

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

this is backwards, should be == ""

underpants.go Outdated
@@ -463,19 +480,21 @@ func setup(c *conf, port int) (*http.ServeMux, error) {
// setup routes
oc := oauthConfig(c, port)
for _, r := range c.Routes {
fmt.Printf("setting up for host : %s\n", r.From)
Copy link
Owner

Choose a reason for hiding this comment

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

We probably don't need these debugging Printlns, right?

underpants.go Outdated

// Fix the host header on the request to the backend proxied service to match
// what came in through the front door.
FixHost bool
Copy link
Owner

Choose a reason for hiding this comment

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

I think the property here should be a little more descriptive. How about pass-through-host-header or retain-host-header. Also be sure to add this directive to one of the sample json files.

Copy link
Author

Choose a reason for hiding this comment

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

I like retain host header .. updating now.

README explaining what the host flag is for.
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.

3 participants