Quantcast
Channel: HAProxy community - Latest topics
Viewing all articles
Browse latest Browse all 4849

Haproxy Forwoard Original IP ADDRESS

$
0
0

Hi everyone, I’m trying to implement haproxy in my infrastructure - but I have a problem even if I use option forwardfor I don’t see the IP address of the client that made the request appear but only that of haproxy. I also configured haproxy with the log-forward option which collects the network logs and sends them to the syslog server. But even there the logs are written with the IP address of the haproxy and not of the client that generated the log.

My Conf

global

    log ring@logbuffer local5
    daemon
    maxconn 256

defaults
    log global
    mode http
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms

log-forward syslog

Accepts incoming TCP messages

bind 192.168.16.46:1514

Accepts incoming UDP messages

dgram-bind 192.168.16.46:1514

Sends outgoing messages via UDP

log ring@logbuffer local0

ring logbuffer
description “buffer for logs”
format rfc5424
maxlen 1500
size 65536
timeout connect 10s
timeout server 20s

Sends outgoing messages via TCP

root@haproxy:/ # cat /usr/local/etc/haproxy.conf
global

    log ring@logbuffer local5
    daemon
    maxconn 256

defaults
    log global
    mode http
    timeout connect 5000ms
    timeout client 50000ms
    timeout server 50000ms

log-forward syslog

Accepts incoming TCP messages

bind 192.168.16.46:1514

Accepts incoming UDP messages

dgram-bind 192.168.16.46:1514

Sends outgoing messages via UDP

log ring@logbuffer local0

ring logbuffer
description “buffer for logs”
format rfc5424
maxlen 1500
size 65536
timeout connect 10s
timeout server 20s

Sends outgoing messages via TCP

server logserver 192.168.10.21:1514 check send-proxy

    frontend fe_rsync
            bind 192.168.16.46:873
            mode tcp
            use_backend be_rsync

    backend be_rsync
            mode tcp
            option forwardfor
            server rsyncd 192.168.10.9:873  send-proxy-v2


    resolvers mynameservers
            nameserver ns1 192.168.10.5:53

Thanks

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>