Technically speaking, finding a real IP of a proxy IP user is not difficult.
In the simplest situation, where a visitor uses a single proxy server to relay traffic to its final destination, the technical part of tracking the user down is easy. You simply need to analyze the proxy server logs, find the connection request to the target server and look at the source IP address.
However, you may encounter a visitor who uses multiple-layered proxies to spoof the IP.
Nginx offers real_ip module. (real_ip_module is not packaged as defualt btw.)
Real_ip_module can detect even multiple-layered proxy IP, provided the proxy IP offers X-Forwarded-For header.
In order to protect yourself from IP spoof, and get real client IP, you need to enable real_ip_recursive and set known proxies using set_real_ip_from. Nginx will remove IPs matching known proxies and then use rightmost IP which is the real IP of the visitor you are tracking.
And an X-Forwarded-For header resulting in:
X-Forwarded-For: 188.8.131.52, 192.168.2.1, 127.0.0.1IP, proxy, tracking
Categorized in: Web Development
This post was written by hackya