Pulling StackPath IP Blocks

Whitelisting StackPath's IP blocks ensures StackPath edge servers can pull data from your origin server. Needing to whitelist StackPath's IP's in firewalls and security systems is the most common reason behind 502 errors.

This guide will show you how to pull the most up to date IP block list at any time. You can use this guide to apply these IPs to the whitelist on your origin. 

Requesting the CDN and WAF IP List

Our CDN and WAF IP blocks can be pulled by making a GET request toward the Get IP addresses endpoint.

This should produce a response with the following JSON object, that contains all of the IPs used by the CDN and WAF to pull content from your origin(truncated):

{
 "results": [
 "2a0a:e200:1a00::/40",
 "2a0a:e200:1c00::/40",
 "2a0a:e200:1100:1100::/64",
 "2a0a:e200:1100::/40",
 "2a0a:e200:1200:1100::/64",
 "2a0a:e200:1200::/40",
 "2a0a:e200:1300::/40",
 "2a0a:e200:1400::/40",
 "2a0a:e200:1500::/40",
.... ] 
}

You can also adjust the scope for this pull by attaching the following queries to the request if you would like to obtain the information in a format other than JSON, or to separate out the IPV4 and IPV6 addresses:

  • https://gateway.stackpath.com/cdn/v1/ips?response_type=PLAIN_TEXT - to force the output to plain text format instead of JSON. 
  • https://gateway.stackpath.com/cdn/v1/ips?filter=IPV4 - to specify only IPV4 addresses
  • https://gateway.stackpath.com/cdn/v1/ips?filter=IPV6 - to specify only IPV6 addresses

Request the Monitoring Service IP List

When Monitoring is enabled for your Stack, the Monitoring service IPs can be pulled by making a GET request to the Get monitoring locations endpoint.

This call should produce a JSON object that lists out every location used by our monitoring service, with information about each location, including the field "ipAddresses" that contains the IP address used to make requests toward your origin.

This will be the in the following format: 

...
{
 "id": "dal-srv",
 "name": "USA: Dallas",
 "city": "Dallas",
 "country": "USA",
 "provider": "StackPath",
 "ipAddresses": [
 "209.107.216.205",
 "209.107.216.206"
 ]
 },
 {
 "id": "lax-vul",
 "name": "USA: Los Angeles",
 "city": "Los Angeles",
 "country": "USA",
 "provider": "Vultr",
 "ipAddresses": [
 "45.32.69.31",
 "45.32.94.5",
 "2001:19f0:6000:9301:5400:ff:fe1c:85",
 "2001:19f0:6000:95c5:5400:ff:fe1c:88"
 ]
 },
...

You can also call just the locations used by your monitor by making a GET request to the Get all monitors endpoint.

This call will return all the information about each monitor in use on your Stack, with an included JSON object called "locations" that contains similar formatting as the previous call, but will only include the monitoring locations enabled for your specific monitor.

"results": [
 {
 "id": "eaf2ffa0-2afb-4351-a344-937bc471bba8",
 "remoteId": "5b393a24b03e85ff038b456b",
 "name": "Testing",
 "url": "https://www.stackpath.com",
 "currentStatus": "slow",
 "uptime": 1,
 "avgResponseTime": 0.37663442459657215,
 "method": "GET",
 "timeout": 10,
 "ipVersion": "IPV4",
 "locations": [
 {
    "id": "fra-edi",
    "name": "Germany: Frankfurt",
    "city": "Frankfurt",
    "country": "Germany",
    "provider": "EDIS GmbH",
    "ipAddresses": [
         "149.154.159.21",
         "151.236.15.26",
         "2a03:f80:49:149:154:159:21:1",
         "2a03:f80:49:151:236:15:26:1"
       ]
 },
...