Created
January 6, 2022 10:04
-
-
Save minetaro12/c8e9183fb1b1507fda8cf79b7f7da75d to your computer and use it in GitHub Desktop.
NginxのCloudflare使用時元のIPアドレスに戻すための設定ファイル作成スクリプト
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
#!/bin/bash | |
touch cloudflare.conf | |
curl https://www.cloudflare.com/ips-v4 | awk 1 > cloudflare.conf | |
curl https://www.cloudflare.com/ips-v6 | awk 1 >> cloudflare.conf | |
sed -i "s/^/set_real_ip_from /" cloudflare.conf | |
sed -i "s/$/;/" cloudflare.conf | |
echo "real_ip_header CF-Connecting-IP;" >> cloudflare.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment