Configure use of Proxy-Protocol seperately for HTTP/HTTPS inbound traffic #12207
Description
Wanted Feature
I would like to enable proxy-protocol for the incoming HTTPS connections but keep it disabled for HTTP.
Use Case
I have another nginx instance in front of the Ingress-Nginx that acts as a reverse proxy for HTTP and HTTPS traffic.
The routing for HTTPS is done using SNI inside a stream
block and the traffic forwarded using proxy-protocol.
For HTTP the Host Header of the request needs to be inspected to determine the correct backend. For that, the http
block is used, which doesn't allow forwarding using proxy-protocol. Instead the usual Headers can be used to preserve the original client IP-Address.
Change required?
I'm not entirely familiar with the templating system used for the nginx config in the nginx template and therefore am not sure if this behavior could be achieved there.
Otherwise, adjustment in the buildHTTP(S)Listener would be required.
Additionally the real-ip-header
would need to be separately configured for the HTTP and HTTPS listener.
Feasibility
Nginx allows for enabling proxy_protocol
per listen directive, so it is viable from the underlying nginx software.
Metadata
Assignees
Labels
Type
Projects
Status
No status