Hello! I have servers with nginx in stream configuration that proxy requests to servers with nginx in http configuration:
[nginx stream] ---> [nginx http]
On servers with nginx http, I need real IP of client, which is taken from TCP session, which is established by client with nginx stream. It looks simple and guide https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/ would help me. But this is not the case!
The fact is that if I enable proxy_protocol on the backend (nginx http), it will not be able to process a simple HTTP request and I will get a response '400 Bad Request'. My virtual http host must work in universal mode, both using proxy_protocol and without it. How can I do this? The option with some intermediate HTTP host on my http nginx that uses proxy_protocol and proxies HTTP requests to simple HTTP host without proxy_protocol will not work for me. Because any worker generates TCP sessions using some unprivileged ports, of which there are few left on my server. If I can't configure http host to paralle work with and without proxy_protocol, then I'm interested in delivering client IP without proxy_protocol.
How do I deliver client IP to backend(nginx http) without enabling proxy_porotocol on both nginx stream and nginx http?
[nginx stream] ---> [nginx http]
On servers with nginx http, I need real IP of client, which is taken from TCP session, which is established by client with nginx stream. It looks simple and guide https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/ would help me. But this is not the case!
The fact is that if I enable proxy_protocol on the backend (nginx http), it will not be able to process a simple HTTP request and I will get a response '400 Bad Request'. My virtual http host must work in universal mode, both using proxy_protocol and without it. How can I do this? The option with some intermediate HTTP host on my http nginx that uses proxy_protocol and proxies HTTP requests to simple HTTP host without proxy_protocol will not work for me. Because any worker generates TCP sessions using some unprivileged ports, of which there are few left on my server. If I can't configure http host to paralle work with and without proxy_protocol, then I'm interested in delivering client IP without proxy_protocol.
How do I deliver client IP to backend(nginx http) without enabling proxy_porotocol on both nginx stream and nginx http?