Tutorial: Track Real Client IP Addresses in Access Server Behind a Proxy, Load Balancer, or Cloudflare
Overview
When you deploy Access Server behind a proxy, reverse proxy, or load balancer, Access Server receives the web request from that intermediary rather than directly from the client.
Starting with Access Server 3.2.2, you can identify both addresses associated with these web requests:
Request IP: The IP address from which Access Server directly receives the request. In a proxied deployment, this is typically the IP address of the proxy, reverse proxy, or load balancer facing Access Server.
Proxied IP: The real client IP address, or original client IP, supplied in a supported HTTP header by the proxy, reverse proxy, or load balancer.
Access Server detects X-Forwarded-For and CF-Connecting-IP by default. CF-Connecting-IP is the header Cloudflare injects to identify the original visitor IP address. You can also configure another header, such as X-Real-IP, when your infrastructure uses a different header for the client address.
This tutorial shows you how to verify the Request IP and Proxied IP in the Activity Log and Access Server logs, test header detection with the Web API, and configure a custom proxied-IP header.
Tracking the original client IP is especially useful for auditing and troubleshooting production secure remote access deployments that place Access Server behind a proxy or load balancer.
Prerequisites
Before you begin, ensure you have:
Access Server 3.2.2 or newer.
Admin Web UI access.
Console access and the ability to get root access.
An administrator account configured in Access Server.
A proxy, reverse proxy, or load balancer for Step 1.
Optional: A remote computer from which you can run Web API requests for Steps 2 and 3.
How Access Server detects X-Forwarded-For and CF-Connecting-IP
By default, Access Server can detect the original client IP from these HTTP request headers:
X-Forwarded-ForCF-Connecting-IP
A proxy or load balancer can add one of these headers before forwarding a request to Access Server.
For example:
Client
192.0.2.5
|
v
Proxy / Load Balancer
198.51.100.5
|
| X-Forwarded-For: 192.0.2.5
v
Access ServerAccess Server can then record:
Request IP: 198.51.100.5
Proxied IP: 192.0.2.5