Last active
June 5, 2022 15:01
-
-
Save kozakana/5661c3bfeb1f6030535469d8067ddf85 to your computer and use it in GitHub Desktop.
CloudFrontのIPアドレスを取得してnginxのset_real_ip_fromの形式で出力
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
curl -s "https://ip-ranges.amazonaws.com/ip-ranges.json" |jq -r '.prefixes | map(select(.service == "CLOUDFRONT").ip_prefix) | "set_real_ip_from" + " " + .[] + ";"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment