Skip to content

Commit

Permalink
Add HTTP_X_FORWARDED_PROTO header
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Oct 6, 2023
1 parent 660a228 commit 834cb54
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions service/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ func forwardHandler(targetUrl string, writer http.ResponseWriter, request *http.
r.Header.Set("X-Real-Ip", clientIP)
}
}

if r.TLS == nil {
r.Header.Set("HTTP_X_FORWARDED_PROTO", "http")
} else {
r.Header.Set("HTTP_X_FORWARDED_PROTO", "https")
}
}

proxy.ServeHTTP(writer, request)
Expand Down

0 comments on commit 834cb54

Please sign in to comment.