Add reverse proxy headers in apiserver proxy.

Fixes #3484
This commit is contained in:
Anthony Yeh
2015-01-19 13:15:41 -08:00
parent fbd4722094
commit 8c900187b6
2 changed files with 68 additions and 43 deletions

View File

@@ -169,6 +169,11 @@ type proxyTransport struct {
}
func (t *proxyTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// Add reverse proxy headers.
req.Header.Set("X-Forwarded-Uri", t.proxyPathPrepend+req.URL.Path)
req.Header.Set("X-Forwarded-Host", t.proxyHost)
req.Header.Set("X-Forwarded-Proto", t.proxyScheme)
resp, err := http.DefaultTransport.RoundTrip(req)
if err != nil {