Skip to content

Commit

Permalink
add some x-forwarded-* headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ruckc authored Aug 3, 2024
1 parent 8aff883 commit eeb9e4e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/goproxygo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ func reverseProxyHandler(destination *url.URL) *httputil.ReverseProxy {
proxy.Director = func(req *http.Request) {
req.Header.Set("Origin", fmt.Sprintf("%s://%s", destination.Scheme, destination.Host))
req.Header.Set("X-Forwarded-Proto", req.URL.Scheme)
req.Header.Set("X-Forwarded-Host", req.Host)
req.Header.Set("X-Forwarded-Port", req.Port)
req.Header.Set("Host", req.Host)
req.Host = req.URL.Host
req.URL.Scheme = destination.Scheme
Expand Down

0 comments on commit eeb9e4e

Please sign in to comment.