set_real_ip_from --how to load IP list file ?

...²º¹³ 416626442 at
Sun Nov 8 06:47:03 UTC 2015

  I'm using CDN with my site.
There are many IPs on network.
set_real_ip_from only can add IP in one line.
I want to add IP list to  file and load it .
How to set ?

PS:   Apache Module mod_remoteip have  RemoteIPTrustedProxyList for this.
But I just want to use nginx. 

RemoteIPTrustedProxyList Directive
Description:Declare client intranet IP addresses trusted to present the RemoteIPHeader value
Syntax:RemoteIPTrustedProxyList filename
Context:server config, virtual host

The RemoteIPTrustedProxyList directive specifies a file parsed at startup, and builds a list of addresses (or address blocks) to trust as presenting a valid RemoteIPHeader value of the useragent IP.

The '#' hash character designates a comment line, otherwise each whitespace or newline separated entry is processed identically to the RemoteIPTrustedProxy directive.

Trusted (Load Balancer) Example
RemoteIPHeader X-Forwarded-For RemoteIPTrustedProxyList conf/trusted-proxies.lst

conf/trusted-proxies.lst contents

# Identified external proxies; #wap phone group of proxies #some well known ISP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list