edit-icon download-icon

Obtain visitors' real IP addresses: ASP, PHP, ASPX, JSP

Last Updated: Dec 15, 2017

After you connect your website to the Web Application Firewall (WAF) service, the source IP addresses of requests to your website are the WAF IP address.

If your website needs to obtain the real IP addresses of visitors, use one of the following methods appropriately:

For ASP

  1. Request.ServerVariables("HTTP_X_REAL_IP")

For ASP.NET(C#)

  1. Request.ServerVariables["HTTP_X_REAL_IP"]

For PHP

  1. $_SERVER["HTTP_X_REAL_IP"]

For JSP

  1. request.getHeader("HTTP_X_REAL_IP")
Thank you! We've received your feedback.