Skip to content

adding in some proxyification adjustments#13

Open
nshttpd wants to merge 4 commits intokellegous:masterfrom
nshttpd:nshttpd/x-forwarded-proto-header
Open

adding in some proxyification adjustments#13
nshttpd wants to merge 4 commits intokellegous:masterfrom
nshttpd:nshttpd/x-forwarded-proto-header

Conversation

@nshttpd
Copy link
Copy Markdown

@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
// user.
AllowedGroups []string `json:"allowed-groups"`

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

@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") != "" {
Copy link
Copy Markdown

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
// setup routes
oc := oauthConfig(c, port)
for _, r := range c.Routes {
fmt.Printf("setting up for host : %s\n", r.From)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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