proxy_protocol
The `proxy_protocol` directive enables the use of the PROXY protocol for conveying client connection information.
Description
The proxy_protocol directive in the NGINX SRT Module specifies whether to enable or disable the PROXY protocol for incoming connections. When set, NGINX will accept incoming connections that utilize the PROXY protocol, which allows the proxy to pass client information (like the original IP address) to the backend server. The PROXY protocol helps systems that rely on the reverse proxy to properly determine the client's details, especially when NGINX is sitting behind another load balancer or proxy.
When the proxy_protocol directive is enabled, the server will expect the incoming connection to be prefixed with protocol headers that describe the source address of the client and other relevant data. This is particularly useful in scenarios where the direct connection to the client is not visible, such as when multiple proxies are in use. The PROXY protocol provides a means to relay this information securely and transparently.
It’s essential to ensure that all intermediaries in the connection path support the PROXY protocol; otherwise, the connection may fail or lead to security leaks. The directive can generally be used in the context of the SRT server block, determining whether the SRT stream data can accompany the proxy metadata when establishing a connection to the backend.
Config Example
srt {
server {
listen 4321;
proxy_protocol;
proxy_pass tcp://127.0.0.1:5678;
}
}Make sure that all clients and proxies in the connection chain support the PROXY protocol; otherwise, connection failures may occur.
Be aware that enabling the PROXY protocol can expose the backend servers to potentially malicious requests if not properly secured.