For a TCP stream, the PROXY protocol can be enabled for connections between NGINX and an upstream server. To enable the PROXY protocol, include the proxy_protocol directive in a server block at the stream {} level:
<span>stream</span> {
<span>server</span> {
<span>listen</span> <span>12345</span>;
<span>proxy_pass</span> example.com:<span>12345</span>;
<span>proxy_protocol</span> <span>on</span>;
}
}...
Additionally, a TCP server (the stream {} block) sends its own PROXY protocol data to its backend servers (the proxy_protocol on directive)