How to track multiple layered proxy IP

October 2, 2015 6:51 pm Published by Leave your thoughts

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.

real_ip_header X-Forwarded-For;
real_ip_recursive on;

And an X-Forwarded-For header resulting in:


Source :

Tags: , ,

Categorized in:

This post was written by hackya

Leave a Reply

Your email address will not be published. Required fields are marked *