Configuring HAProxy to send X_FORWARDED_FOR and X_REAL_IP at the same time.

2014-05-26 Thread Daniel Todorov
Hello,

I'm working for company which have software based on both headers, and if
one of them is missing, the software is not working properly. I find a way
to configure HAProxy to send each of them but separated. I need to find
solution which will make HAProxy to send both. Can I use reqadd or
http-request add-header/set-header to set a the second header?

Best Regards,
Daniel Todorov


Re: Configuring HAProxy to send X_FORWARDED_FOR and X_REAL_IP at the same time.

2014-05-26 Thread Baptiste
On Mon, May 26, 2014 at 10:03 AM, Daniel Todorov leinad...@gmail.com wrote:
 Hello,

 I'm working for company which have software based on both headers, and if
 one of them is missing, the software is not working properly. I find a way
 to configure HAProxy to send each of them but separated. I need to find
 solution which will make HAProxy to send both. Can I use reqadd or
 http-request add-header/set-header to set a the second header?

 Best Regards,
 Daniel Todorov

Hi Daniel

Yes, you can use http-request add-header to add headers. You can
extract source IP address using the acl 'src'.

Baptiste



Re: Configuring HAProxy to send X_FORWARDED_FOR and X_REAL_IP at the same time.

2014-05-26 Thread Thomas Heil
Hi,
On 26.05.2014 12:16, Daniel Todorov wrote:
 Hello Baptiste,

 can i extract the info from other header, because we using cloudflare
 infront of HAProxy?

You can also do things like,
--
http-request add-header X-Orig-IP %[req.hdr(X-Forwarded-For)]
--

this would add header X-Orig-IP with the values from X-Forwarded-For


 Best Regards,


 On Mon, May 26, 2014 at 12:15 PM, Baptiste bed...@gmail.com
 mailto:bed...@gmail.com wrote:

 On Mon, May 26, 2014 at 10:03 AM, Daniel Todorov
 leinad...@gmail.com mailto:leinad...@gmail.com wrote:
  Hello,
 
  I'm working for company which have software based on both
 headers, and if
  one of them is missing, the software is not working properly. I
 find a way
  to configure HAProxy to send each of them but separated. I need
 to find
  solution which will make HAProxy to send both. Can I use reqadd or
  http-request add-header/set-header to set a the second header?
 
  Best Regards,
  Daniel Todorov

 Hi Daniel

 Yes, you can use http-request add-header to add headers. You can
 extract source IP address using the acl 'src'.

 Baptiste