HTTP directives
set_real_ip_from directive (HTTP)
Contexts: http, server, location. No default trusted address. Requires HTTP Real IP module. Define approved immediate peers and trusted hops.
Formal Syntax & Structure
nginx syntaxnginx
set_real_ip_from address | CIDR | unix:;Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| address | IP address | CIDR | hostname | unix: | Trust only controlled proxy peers that supply validated client identity. Hostnames supported since 1.13.1. |
Working Example
Example Snippetnginx
set_real_ip_from 192.0.2.10/32;