On Sun, Dec 30, 2012 at 02:38:09AM +0100, Lorenzo R. wrote:
Hi there,
What about adding the possibility to retrieve a list of set_real_ip_from
from a text file online?
With the “include” directive and “nginx -s reload”, have you not enough
support in nginx to do this already?
An external script to periodically fetch the url contents, stick
"set_real_ip_from " at the start and “;” at the end (or do whatever
other
manipulation is needed to make correct nginx.conf syntax) and save to
a local file, and then get nginx to use the updated config?
I’m not sure what extra benefit there would be to building something
like this in to nginx.
The idea is to have it built-in, without having to arrange a script that
fetches an external file and appends each line to set_real_ip_from and
adds
a ;
It would be a hundreds bytes add and IMO would help many. It’s just an
idea
anayway.
On Sun, Dec 30, 2012 at 8:33 PM, Lorenzo R. [email protected] wrote:
The idea is to have it built-in, without having to arrange a script that
fetches an external file and appends each line to set_real_ip_from and adds
a ;
It would be a hundreds bytes add and IMO would help many. It’s just an idea
anayway.
do you really need this one liner built into nginx?
Anyway if can be useful for others in the future here’s the script to
fetch
2 files and mix 'em together preserving the set_real_ip_from formatting:
{
curl -s https://www.cloudflare.com/ips-v4
printf ‘\n’
curl -s https://www.cloudflare.com/ips-v6
} | sed -r ‘s/^(.+)$/set_real_ip_from \1;/g’ > some-list.conf && nginx
-s
reload