VergeCloud employs a reverse proxy approach, meaning the visitor IP addresses displayed in logs often show VergeCloud's IP instead of the actual visitor IPs. To address this, VergeCloud stores the real IP addresses in dedicated HTTP headers, which can be logged using configurations for Nginx, Apache, and IIS.
To capture the actual IP addresses in Nginx, use the following headers:
log_format test1 ‘… $http_x_real_ip $http_ar_real_ip $http_x_real_ip…’
Configure the log format as follows:
access_log test1;
An example configuration may look like this:
log_format test1 '$http_x_real_ip - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent'
'"$http_referer" "$http_user_agent "$http_ar_real_ip" "$http_x_real_ip"';
To log the true IP addresses in Apache, include these values in your log format:
"%{X-Forwarded-For} %{X-Real-Ip} %{x-real-ip}i"
A basic log format example in Apache:
LogFormat " %h %l %u %t \"%r\" %>s %b %{X-Forwarded-For} %{X-Real-Ip} %{x-real-ip}i" test1
To log true IP addresses in IIS:
x-real-ip
X-Real-Ip
X-Forwarded-For