nginx_tcp_proxy_module
nginx_tcp_proxy_module copied to clipboard
(WIP) PROXY protocol support
This PR is a hack that implements PROXY protocol (http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt) which allows upstream TCP servers to be notified the original IP and port of the client.
Tested with nginx 1.7.9.
Sorry about whitespace changes and probable code quality as I'm not familiar with C and this is my first bit of work on an nginx module.
The function in question: https://github.com/yaoweibin/nginx_tcp_proxy_module/pull/110/files#diff-439a7558cb55631857d62112acec7449R237
Example configuration:
tcp {
upstream backend {
server 127.0.0.1:4221;
accept_proxy on;
}
server {
listen 4222;
proxy_pass backend;
}
}
Issues:
- The destination IP and port is wrong. I can't seem to find a proper reference to the socket the connection was accepted on. We don't use the destination IP/port anyway so it's not critical for us.
Remove the useless spaces is good for me. Thank you.
I'm reviewing this pull request.
Hi, any news about this PR ?