Help us understand the problem. What is going on with this article?

[AWS] CloudFront が使用する IP レンジを調べる

More than 1 year has passed since last update.

すぐわからなくなるのでメモ

curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq  -r '.prefixes[] | select(.service=="CLOUDFRONT")

nginx の set_real_ip_from ディレクティブを生成するには以下の通り

$ curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq  -r '.prefixes[] | select(.service=="CLOUDFRONT") | .ip_prefix' | awk '{print "set_real_ip_from " $1 ";"}'
set_real_ip_from 13.32.0.0/15;
set_real_ip_from 13.35.0.0/16;
set_real_ip_from 13.54.63.128/26;
set_real_ip_from 13.59.250.0/26;
set_real_ip_from 13.113.203.0/24;
set_real_ip_from 13.124.199.0/24;
set_real_ip_from 13.228.69.0/24;
set_real_ip_from 18.216.170.128/25;
set_real_ip_from 34.195.252.0/24;
set_real_ip_from 34.216.51.0/25;
set_real_ip_from 34.226.14.0/24;
set_real_ip_from 34.232.163.208/29;
set_real_ip_from 35.158.136.0/24;
set_real_ip_from 35.162.63.192/26;
set_real_ip_from 35.167.191.128/26;
set_real_ip_from 52.15.127.128/26;
set_real_ip_from 52.46.0.0/18;
set_real_ip_from 52.47.139.0/24;
set_real_ip_from 52.52.191.128/26;
set_real_ip_from 52.56.127.0/25;
set_real_ip_from 52.57.254.0/24;
set_real_ip_from 52.66.194.128/26;
set_real_ip_from 52.78.247.128/26;
set_real_ip_from 52.84.0.0/15;
set_real_ip_from 52.199.127.192/26;
set_real_ip_from 52.212.248.0/26;
set_real_ip_from 52.220.191.0/26;
set_real_ip_from 52.222.128.0/17;
set_real_ip_from 54.182.0.0/16;
set_real_ip_from 54.192.0.0/16;
set_real_ip_from 54.230.0.0/16;
set_real_ip_from 54.233.255.128/26;
set_real_ip_from 54.239.128.0/18;
set_real_ip_from 54.239.192.0/19;
set_real_ip_from 54.240.128.0/18;
set_real_ip_from 70.132.0.0/18;
set_real_ip_from 143.204.0.0/16;
set_real_ip_from 204.246.164.0/22;
set_real_ip_from 204.246.168.0/22;
set_real_ip_from 204.246.174.0/23;
set_real_ip_from 204.246.176.0/20;
set_real_ip_from 205.251.192.0/19;
set_real_ip_from 205.251.249.0/24;
set_real_ip_from 205.251.250.0/23;
set_real_ip_from 205.251.252.0/23;
set_real_ip_from 205.251.254.0/24;
set_real_ip_from 216.137.32.0/19;
digitalcubeinc
デジタルキューブは AWS Partner Network (APN) アドバンスドテクノロジーパートナーです。
https://ja.amimoto-ami.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away