1
0
mirror of https://github.com/bingohuang/docker-labs.git synced 2025-10-05 18:03:21 +08:00

Allow to send subdomains but forward header as is to backends

This commit is contained in:
Marcos Lilljedahl
2017-02-17 13:58:53 -03:00
parent 9e57f3b61c
commit 0df09bebdb
4 changed files with 12 additions and 18 deletions

View File

@@ -16,7 +16,7 @@ func NewMultipleHostWebsocketReverseProxy() *wsutil.ReverseProxy {
director := func(req *http.Request) {
v := mux.Vars(req)
node, port, host := getTargetInfo(v, req)
node, port := getTargetInfo(v, req)
if port == "443" {
// Only proxy http for now
@@ -25,7 +25,6 @@ func NewMultipleHostWebsocketReverseProxy() *wsutil.ReverseProxy {
// Only proxy http for now
req.URL.Scheme = "ws"
}
req.Host = host
req.URL.Host = fmt.Sprintf("%s:%s", node, port)
}