Use proxy-protocol to pass through source IP to nginx

This commit is contained in:
David Pratt 2017-04-28 17:21:47 -05:00
parent 317f222527
commit d56d8b7da1
3 changed files with 31 additions and 6 deletions

View file

@ -88,6 +88,7 @@ func newNGINXController() ingress.Controller {
Hostname: "localhost",
IP: "127.0.0.1",
Port: 442,
ProxyProtocol: true,
},
},
}
@ -531,10 +532,12 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) ([]byte, er
}
}
//TODO: Allow PassthroughBackends to specify they support proxy-protocol
servers = append(servers, &server{
Hostname: pb.Hostname,
IP: svc.Spec.ClusterIP,
Port: port,
ProxyProtocol: false,
})
}