Skip to content

Commit efb392f

Browse files
author
speruri
committed
Apply PROXY protocol wrapper to insecure listener when both are enabled
When both EnableProxyProtocol and InsecureAddress are configured, the insecure listener (HTTP) was created without the PROXY protocol wrapper. This caused 400 Bad Request errors when NLB sent PROXY protocol v2 headers to the HTTP target port. Now both the main (HTTPS) and insecure (HTTP) listeners get wrapped with the PROXY protocol handler when EnableProxyProtocol is true. This fixes HTTP->HTTPS redirects when NLB PROXY protocol v2 is enabled. Signed-off-by: speruri <surya.srikar.peruri@zalando.de>
1 parent 401a924 commit efb392f

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

skipper.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,12 +1544,20 @@ func listenAndServeQuit(
15441544
log.Infof("Insecure listener on %v", o.InsecureAddress)
15451545

15461546
go func() {
1547-
l, err := listen(o, o.InsecureAddress, mtr)
1547+
insecureL, err := listen(o, o.InsecureAddress, mtr)
15481548
if err != nil {
15491549
log.Errorf("Failed to start insecure listener on %s: %v", o.InsecureAddress, err)
15501550
}
15511551

1552-
if err := srv.Serve(l); err != http.ErrServerClosed {
1552+
if o.EnableProxyProtocol {
1553+
insecureL, err = proxyListener(insecureL, o)
1554+
if err != nil {
1555+
log.Errorf("Failed to start proxy listener for insecure address: %v", err)
1556+
return
1557+
}
1558+
}
1559+
1560+
if err := srv.Serve(insecureL); err != http.ErrServerClosed {
15531561
log.Errorf("Insecure listener serve failed: %v", err)
15541562
}
15551563
}()

0 commit comments

Comments
 (0)