You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in net/http/httputil/reverseproxy.go in ServeHTTP the code currently replaces
any prior value set to X-Forwarded-For. The de-facto standard is to append the value for
each additional proxy. You can see the problem by simply running the go reverse proxy
behind another proxy and the header will be replaced.
The problem is trivial to fix by replacing the Set call in this:
outreq.Header.Set("X-Forwarded-For", clientIp)
to an Add like this:
outreq.Header.Add("X-Forwarded-For", clientIp)