fix: fix host forwrading
This commit is contained in:
@@ -76,6 +76,7 @@ func (proxyRoute ProxyRoute) ProxyHandler() http.HandlerFunc {
|
|||||||
r.Header.Set("X-Forwarded-Host", r.Header.Get("Host"))
|
r.Header.Set("X-Forwarded-Host", r.Header.Get("Host"))
|
||||||
r.Header.Set("X-Forwarded-For", getRealIP(r))
|
r.Header.Set("X-Forwarded-For", getRealIP(r))
|
||||||
r.Header.Set("X-Real-IP", getRealIP(r))
|
r.Header.Set("X-Real-IP", getRealIP(r))
|
||||||
|
r.Host = targetURL.Host
|
||||||
}
|
}
|
||||||
backendURL, _ := url.Parse(proxyRoute.destination)
|
backendURL, _ := url.Parse(proxyRoute.destination)
|
||||||
if len(proxyRoute.backends) > 0 {
|
if len(proxyRoute.backends) > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user