Receive original IP throught proxies and LTM or no header at all
Hello,
Currently. We are working on on this Irule which keeps all x-forward headers sent by our proxies (You will surely recognize it) :
when HTTP_REQUEST { HTTP::header insert HeadTrans [HTTP::header all];
if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For "[HTTP::header X-Forwarded-For]"; } else { HTTP::header insert X-Forwarded-For [getfield [IP::client_addr] "%" 1]; }
Have question about this. If I just want to keep the first action and remove the "else" part... Which mean if the LTM don't found any existing headers I would like to have no header at all. Do I have to have explicit "else { do nothing } or can I only keep my first condition like :
when HTTP_REQUEST { HTTP::header insert HeadTrans [HTTP::header all];
if {[HTTP::header exists X-Forwarded-For]}{ HTTP::header replace X-Forwarded-For "[HTTP::header X-Forwarded-For]"; }
Best regards,
Yves