Hi,

Please help me to solve this problem.

I use HAProxy version 1.5.18, SSL transparent mode and I can not get client IP 
in my .net mvc website. With mode http, I can use option forwardfor to catch 
client ip but with tcp mode, my web read X_Forwarded_For is null.

 

My diagram:

Client => Firewall => HAProxy => Web

 

I read HAProxy document, try to use send-proxy. But when use send-proxy, I can 
access my web.

This is my config:

frontend test2233

        bind *:2233

        option forwardfor

 

        default_backend testecus

backend testecus

        mode http

        server web1 192.168.0.151:2233 check

Above config work, and I can get the client IP

 

Config with SSL:

frontend ivan

         bind 192.168.0.4:443

        mode tcp

        option tcplog

#option forwardfor

            reqadd X-Forwarded-Proto:\ https

    acl tls req.ssl_hello_type 1

    tcp-request inspect-delay 5s

    tcp-request content accept if tls

 

        # Define hosts

        acl host_1 req.ssl_sni -i ebh.vn

        acl host_2 req.ssl_sni hdr_end(host) -i einvoice.com.vn

     

       use_backend eBH if host_1

       use_backend einvoice443 if host_2

      

backend eBH

        mode tcp

        balance roundrobin

        option ssl-hello-chk

       server web1 192.168.0.153:443 maxconn 30000 check #cookie web1

       server web1 192.168.0.154:443 maxconn 30000 check #cookie web2

 

Above config doesn’t work, and I can not get the client ip. I try server web1 
192.168.0.153:443 send-proxy and try server web1 192.168.0.153:443 
send-proxy-v2 but I can’t access my web.

 

Many thanks,

Thanks & Best Regards! 
****************************
 VU XUAN HOC
 Mobile: 0169.8081005

THAISON TECHNOLOGY DEVELOPMENT COMPANY
  Add           :  11 Dang Thuy Tram, Hoang Quoc Viet, Cau Giay, Ha Noi
  Tel             : +84.4.37545222 
  Fax            : +84.4.37545223
  Email         :  <mailto:[email protected]> [email protected]
  Web           :  <http://www.thaison.vn> http://www.thaison.vn ;  
<http://www.einvoice.vn> http://www.einvoice.vn;   <http://www.etax.vn> 
http://www.etax.vn;   <http://www.ebh.vn> http://www.ebh.vn

 

Reply via email to