-
Notifications
You must be signed in to change notification settings - Fork 16
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
base: master
Are you sure you want to change the base?
adding in some proxyification adjustments #13
Conversation
one there. in case underpants is part of a request chain.
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 |
There was a problem hiding this comment.
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") != "" { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.