IP address logging settings for the workstation, which allows access to object, in access protocol depend on whether there is a balancer between web servers cluster and web application.
The configuration with balancer located between web servers cluster and web application:
Determine settings:
Comment the strings in the balancer in the location directive:
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Replace them with the string:
proxy_set_header userhostaddress $proxy_add_x_forwarded_for;
On web servers in the configuration file:
/etc/apache2/apache2.conf for Debian-based distributions.
/etc/httpd/conf/httpd.conf for RedHat-based distributions.
/etc/httpd2/conf/httpd2.conf for ALT Linux.
Comment the strings:
SetEnvIf REMOTE_ADDR "^(.+)$" USER_CLIENT_ADDR=$1
RequestHeader merge userhostaddress "%{USER_CLIENT_ADDR}e"
The configuration without balancer located between web servers cluster and web application:
On web servers in the configuration file:
/etc/apache2/apache2.conf for Debian-based distributions.
/etc/httpd/conf/httpd.conf for RedHat-based distributions.
/etc/httpd2/conf/httpd2.conf for ALT Linux.
Check if the following strings are present:
SetEnvIf REMOTE_ADDR "^(.+)$" USER_CLIENT_ADDR=$1
RequestHeader merge userhostaddress "%{USER_CLIENT_ADDR}e"
See also: