Skip to content

Instantly share code, notes, and snippets.

@matdave
Created August 8, 2019 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matdave/e57dedf8006d5a54ab384d93028abe62 to your computer and use it in GitHub Desktop.
Save matdave/e57dedf8006d5a54ab384d93028abe62 to your computer and use it in GitHub Desktop.
Stackpath nginx Real IP
#list of trusted IPs
set_real_ip_from 69.16.133.0/24
set_real_ip_from 69.16.176.0/20
set_real_ip_from 69.16.182.0/24
set_real_ip_from 69.16.184.0/24
set_real_ip_from 69.16.188.0/24
set_real_ip_from 74.209.134.0/24
set_real_ip_from 74.209.134.128/25
set_real_ip_from 81.171.60.0/24
set_real_ip_from 81.171.61.0/24
set_real_ip_from 81.171.68.64/26
set_real_ip_from 81.171.105.0/24
set_real_ip_from 81.171.106.64/26
set_real_ip_from 81.171.112.0/24
set_real_ip_from 94.46.144.0/20
set_real_ip_from 94.46.153.128/25
set_real_ip_from 94.46.154.128/25
set_real_ip_from 94.46.155.128/25
set_real_ip_from 103.66.28.0/22
set_real_ip_from 103.228.104.0/24
set_real_ip_from 146.88.130.128/25
set_real_ip_from 151.139.0.0/17
set_real_ip_from 151.139.0.0/19
set_real_ip_from 151.139.11.128/25
set_real_ip_from 151.139.13.0/24
set_real_ip_from 151.139.14.128/25
set_real_ip_from 151.139.15.128/25
set_real_ip_from 151.139.16.128/25
set_real_ip_from 151.139.18.128/25
set_real_ip_from 151.139.19.128/25
set_real_ip_from 151.139.21.0/24
set_real_ip_from 151.139.23.0/24
set_real_ip_from 151.139.24.0/25
set_real_ip_from 151.139.25.0/24
set_real_ip_from 151.139.29.0/24
set_real_ip_from 151.139.32.0/24
set_real_ip_from 151.139.33.128/25
set_real_ip_from 151.139.34.128/25
set_real_ip_from 151.139.35.128/25
set_real_ip_from 151.139.36.128/25
set_real_ip_from 151.139.37.128/25
set_real_ip_from 151.139.38.128/25
set_real_ip_from 151.139.40.0/22
set_real_ip_from 151.139.41.0/24
set_real_ip_from 151.139.44.0/22
set_real_ip_from 151.139.45.0/24
set_real_ip_from 151.139.48.0/22
set_real_ip_from 151.139.49.0/24
set_real_ip_from 151.139.52.0/22
set_real_ip_from 151.139.56.128/25
set_real_ip_from 151.139.58.0/23
set_real_ip_from 151.139.59.0/24
set_real_ip_from 151.139.60.0/22
set_real_ip_from 151.139.64.0/23
set_real_ip_from 151.139.66.0/23
set_real_ip_from 151.139.67.0/24
set_real_ip_from 151.139.68.0/22
set_real_ip_from 151.139.72.0/22
set_real_ip_from 151.139.76.0/23
set_real_ip_from 151.139.77.0/24
set_real_ip_from 151.139.78.0/23
set_real_ip_from 151.139.80.0/22
set_real_ip_from 151.139.81.0/24
set_real_ip_from 151.139.84.0/22
set_real_ip_from 151.139.88.0/23
set_real_ip_from 151.139.90.0/23
set_real_ip_from 151.139.92.0/23
set_real_ip_from 151.139.93.0/24
set_real_ip_from 151.139.94.0/23
set_real_ip_from 151.139.96.0/23
set_real_ip_from 151.139.97.0/24
set_real_ip_from 151.139.98.0/23
set_real_ip_from 151.139.114.0/23
set_real_ip_from 151.139.116.0/23
set_real_ip_from 151.139.118.0/23
set_real_ip_from 151.139.120.0/22
set_real_ip_from 173.245.194.0/24
set_real_ip_from 173.245.208.64/26
set_real_ip_from 173.245.210.64/26
set_real_ip_from 173.245.216.64/26
set_real_ip_from 173.245.218.64/26
set_real_ip_from 205.185.216.0/22
set_real_ip_from 205.185.217.0/24
set_real_ip_from 205.185.219.0/25
set_real_ip_from 209.197.7.0/24
set_real_ip_from 209.197.8.0/21
set_real_ip_from 209.197.9.0/24
set_real_ip_from 209.197.11.0/24
set_real_ip_from 209.197.13.224/27
set_real_ip_from 209.197.21.0/24
set_real_ip_from 209.197.24.0/21
set_real_ip_from 209.197.27.128/25
set_real_ip_from 209.197.31.0/25
set_real_ip_from 209.234.242.0/25
#To ignore the trusted IPs, and only use IPs not present on the list
real_ip_recursive on;
#To specify the header to use for the module
real_ip_header x-forwarded-for;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment