Created
November 11, 2022 22:44
-
-
Save LaurenceJJones/7e7e386bb1f0dae7054c95df2722a4bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET_FILE=/etc/nginx/conf.d/cloudflare.conf | |
REAL_HEADER=CF-Connecting-IP | |
echo "# AUTOGENERATED FILE" > $TARGET_FILE | |
for i in `curl -s https://www.cloudflare.com/ips-v4`; | |
do | |
echo "set_real_ip_from $i;" >> $TARGET_FILE | |
done | |
for i in `curl -s https://www.cloudflare.com/ips-v6`; | |
do | |
echo "set_real_ip_from $i;" >> $TARGET_FILE | |
done | |
echo "real_ip_header $REAL_HEADER;" >> $TARGET_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment