RE: Remote ip address as a header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Niranjan,

You’re probably looking for the functionality of  mod_emoteip (https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html).

I followed the guide at https://www.globo.tech/learning-center/x-forwarded-for-ip-apache-web-server/ to set it up.

What wasn’t clear to me is that you need to add the mod_remoteip module on the backend server.
If you’re using mod_proxy or similar the X-Forwarded-For header is added automatically.
The mod_remoteip replaces the client IP in the headers with the value of the (first) IP in X-Forwarded-For when it matches one of the trusted IP’s (set in RemoteIPInternalProxy or RemoteIPTrustedProxy).

HTH

Bram

From: Niranjan Rao <nhrdls@xxxxxxxxx> 
Sent: Tuesday, 5 January 2021 19:50
To: users@xxxxxxxxxxxxxxxx
Subject:  Remote ip address as a header

Greetings,

Server version: Apache/2.4.29 (Ubuntu)

I am trying to forward remote ip address to my backend server. Visit to backend server involves multiple hops between various load balancers until ip address is used. We tried following in the config file to set the X-REQUEST-IP address header to carry it forward from the entry point, but not seeing the header set.

Header set X-REQUEST-IP %{REMOTE_ADDR}s

Is this the right way to do it?

Regards,

Niranjan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux