[Haproxy] Forwarding Client IP’s from HAProxy to the Backend Web Server

Hướng dẫn khai báo Forwarding Client IP’s của HAProxy đến Backend Web Server

Mở file haproxy.cfg

vi /etc/haproxy/haproxy.cfg

Thêm vào 2 dòng sau ở phần backend

backend Web_Server
    mode http
    http-request add-header X-Forwarded-For %[src]
    http-request set-header X-Forwarded-Port %[dst_port]

Chúc các bạn thành công.

Bình luận