2025-11-04
This commit is contained in:
parent
e4eaf6404a
commit
66397de267
101 changed files with 2573 additions and 58 deletions
19
containers/conf/angie/scripts/cloudflare.sh
Executable file
19
containers/conf/angie/scripts/cloudflare.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
CLOUDFLARE_FILE_PATH=/etc/nginx/snippets/cloudflare.conf
|
||||
|
||||
echo "# Include this file in your vhost" > $CLOUDFLARE_FILE_PATH
|
||||
echo "" >> $CLOUDFLARE_FILE_PATH
|
||||
|
||||
for i in $(curl https://www.cloudflare.com/ips-v4); do
|
||||
echo "set_real_ip_from $i;" >> $CLOUDFLARE_FILE_PATH
|
||||
done
|
||||
for i in $(curl https://www.cloudflare.com/ips-v6); do
|
||||
echo "set_real_ip_from $i;" >> $CLOUDFLARE_FILE_PATH
|
||||
done
|
||||
|
||||
echo "" >> $CLOUDFLARE_FILE_PATH
|
||||
echo "real_ip_header CF-Connecting-IP;" >> $CLOUDFLARE_FILE_PATH
|
||||
|
||||
#test configuration and reload nginx
|
||||
nginx -t && service nginx reload
|
||||
Loading…
Add table
Add a link
Reference in a new issue