<div>Hi,</div><div> I'm using CDN with my site.</div><div>There are many IPs on network.</div><div><a href="http://nginx.org/en/docs/http/ngx_http_realip_module.html">set_real_ip_from</a> only can add IP in one line.</div><div>I want to add IP list to file and load it .</div><div>How to set ?</div><div><br></div><div>PS: Apache Module mod_remoteip have RemoteIPTrustedProxyList for this.</div><div>But I just want to use nginx.</div><div><br></div><div><a href="http://httpd.apache.org/docs/2.4/mod/mod_remoteip.html">http://httpd.apache.org/docs/2.4/mod/mod_remoteip.html</a>
</div><blockquote style="margin-top: 0.8em; margin-right: 0px; margin-bottom: 0.8em; margin-left: 2em; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0.7em; border-left-width: 2px; border-left-style: solid; border-left-color: rgb(221, 221, 221); " formatblock="1"><h2 style="padding-top: 0.2em; padding-right: 0px; padding-bottom: 0.2em; padding-left: 0.7em; margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; font-size: 18px; font-family: Arial, Helvetica, sans-serif; line-height: normal; "><span style="color: rgb(0, 0, 255);"><a name="RemoteIPTrustedProxyList" id="RemoteIPTrustedProxyList" style="background-color: inherit; ">RemoteIPTrustedProxyList</a> <a name="remoteiptrustedproxylist" id="remoteiptrustedproxylist" style="background-color: inherit; ">Directive</a></span></h2><table class="directive" style="font-size: 14px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(170, 170, 170); border-right-color: rgb(170, 170, 170); border-bottom-color: rgb(170, 170, 170); border-left-color: rgb(170, 170, 170); border-image: initial; border-collapse: collapse; padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; margin-top: 0.5em; margin-bottom: 1em; color: rgb(0, 51, 102); font-family: Arial, Helvetica, sans-serif; "><tbody><tr><th style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; white-space: nowrap; "><a href="http://httpd.apache.org/docs/2.4/mod/directive-dict.html#Description" style="color: rgb(90, 136, 181); background-color: inherit; ">Description:</a></th><td style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; ">Declare client intranet IP addresses trusted to present the RemoteIPHeader value</td></tr><tr><th style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; white-space: nowrap; "><a href="http://httpd.apache.org/docs/2.4/mod/directive-dict.html#Syntax" style="color: rgb(90, 136, 181); background-color: inherit; ">Syntax:</a></th><td style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; "><code style="font-family: 'Courier New', Courier, monospace; font-size: 1em; ">RemoteIPTrustedProxyList <var>filename</var></code></td></tr><tr><th style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; white-space: nowrap; "><a href="http://httpd.apache.org/docs/2.4/mod/directive-dict.html#Context" style="color: rgb(90, 136, 181); background-color: inherit; ">Context:</a></th><td style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; ">server config, virtual host</td></tr><tr><th style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; white-space: nowrap; "><a href="http://httpd.apache.org/docs/2.4/mod/directive-dict.html#Status" style="color: rgb(90, 136, 181); background-color: inherit; ">Status:</a></th><td style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; ">Base</td></tr><tr><th style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; white-space: nowrap; "><a href="http://httpd.apache.org/docs/2.4/mod/directive-dict.html#Module" style="color: rgb(90, 136, 181); background-color: inherit; ">Module:</a></th><td style="empty-cells: show; padding-top: 0.1em; padding-right: 0.2em; padding-bottom: 0.1em; padding-left: 0.2em; vertical-align: top; text-align: left; line-height: 1.3em; ">mod_remoteip</td></tr></tbody></table><p style="line-height: 1.3em; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); font-family: Arial, Helvetica, sans-serif; ">The <code class="directive" style="font-family: 'Courier New', Courier, monospace; font-size: 1em; color: rgb(40, 127, 0); background-color: inherit; "><a href="http://httpd.apache.org/docs/2.4/mod/mod_remoteip.html#remoteiptrustedproxylist" style="color: rgb(53, 165, 0); background-color: inherit; ">RemoteIPTrustedProxyList</a></code> 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.</p><p style="line-height: 1.3em; margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(0, 51, 102); font-family: Arial, Helvetica, sans-serif; ">The '<code style="font-family: 'Courier New', Courier, monospace; font-size: 1em; ">#</code>' hash character designates a comment line, otherwise each whitespace or newline separated entry is processed identically to the <code class="directive" style="font-family: 'Courier New', Courier, monospace; font-size: 1em; color: rgb(40, 127, 0); background-color: inherit; "><a href="http://httpd.apache.org/docs/2.4/mod/mod_remoteip.html#remoteiptrustedproxy" style="color: rgb(53, 165, 0); background-color: inherit; ">RemoteIPTrustedProxy</a></code> directive.</p><div class="example" style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; margin-top: 1em; margin-right: 2em; margin-bottom: 1em; margin-left: 1em; font-family: Arial, Helvetica, sans-serif; line-height: normal; "><h3 style="background-color: inherit; color: rgb(0, 51, 102); font-size: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">Trusted (Load Balancer) Example</h3><pre class="prettyprint lang-config prettyprinted" style="font-family: 'Courier New', Courier, monospace; margin-top: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-image: initial; overflow-x: auto; overflow-y: hidden; background-color: rgb(229, 236, 243); margin-bottom: 0px; border-width: initial; border-color: initial; font-size: 13px; "><span class="kwd" style="color: rgb(17, 34, 136); font-weight: bold; ">RemoteIPHeader</span><span class="pln"> X-Forwarded-For
</span><span class="kwd" style="color: rgb(17, 34, 136); font-weight: bold; ">RemoteIPTrustedProxyList</span><span class="pln"> conf</span><span class="pun" style="color: rgb(102, 102, 0); ">/</span><span class="pln">trusted-proxies</span><span class="pun" style="color: rgb(102, 102, 0); ">.</span><span class="pln">lst</span></pre></div><div class="example" style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; margin-top: 1em; margin-right: 2em; margin-bottom: 1em; margin-left: 1em; font-family: Arial, Helvetica, sans-serif; line-height: normal; "><h3 style="background-color: inherit; color: rgb(0, 51, 102); font-size: 14px; margin-top: 0px; margin-right: 0px; margin-bottom: 0.5em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-align: left; ">conf/trusted-proxies.lst contents</h3><p style="margin-top: 0px; line-height: 1em; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><code style="font-family: 'Courier New', Courier, monospace; font-size: 13px; "># Identified external proxies;<br>192.0.2.16/28 #wap phone group of proxies<br>proxy.isp.example.com #some well known ISP</code></p></div></blockquote>