HTTP - Request IP Address

About

The users / original IP address of a request is stored in the following headers

With this IP, you can perform geolocalization of your users

X-Forwarded-For

An HTTP reverse proxy uses non-standard headers to inform the upstream server about the user’s IP address and other request properties:

X-Forwarded-For: ipClient, ipProxy1, ipProxy2
X-Real-IP: 12.34.56.78
X-Forwarded-Host: example.com
X-Forwarded-Proto: https

where:

Client Restoration

On web server, you can restore the IP in the http log to the client IP (and not to the proxy) via:

  • a module of the server 1)
  • or by modifying the log format

For instance, with nginx:

log_format  proxy  '$http_x_forwarded_for - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" ""';
access_log  /var/log/nginx/access.log proxy;

Documentation





Discover More
HTTP - Gateway (Reverse Proxy)

A reverse proxy (or gateway) is a proxy that is configured to appear to the client just like an ordinary web server. Traffic from the internet at large enters system through reverse proxy, which then...
Origin Http Header
HTTP - Origin Server (Header Field)

The Origin header is: a header field added to a request by the browser (ie client) with the origin value that indicate the source of the code (HTML, Javascript, ...) that created the request....
Data System Architecture
Spatial - Geolocalization (from IP,..)

Geolocalization is possible from a remote client IP such as the X_REAL_IP IP of HTTP By providing an Ip address, you can get this kind of information ...
Web - Log (Http log)

A Web Log is a log file that logs information over a request and response. See: the log from the Apache server the Nginx log The information that may be listed in a http server log are information...
Regexp
What is Grok? and example

Grok is an extension of regular expressions that supports expressions as variables (so they can be reused) In this example, we will construct an expression that matches the part of a string time...
Card Puncher Data Processing
What is a user-event tracker ? (Analytics Script)

Trackers are client or server-side libraries which track user behavior by sending events. There are two methods of tracking: (Recommended): Events are generated on the server : Events are generated...



Share this page:
Follow us:
Task Runner