Important note

The EdgeRules feature is available only on Enterprise plans.

Everyone faced with an error page every once in a while. But what is frustrating with 3rd party services is that you can’t manage how 404 (or other error message) will look and interact with clients ending up on nonexistent locations.

  1. We have a directive within the edge rules which you can use to redirect error responses from CDN to your custom error page location. Directive is called ERROR PAGE and below is one example use case:

  2. Note that in order to catch and forward the appropriate error you need to define two arguments:

    • Error code
    • Error page destination
  3. CURL Example

          curl -I http://foo.bar.netdna-cdn.com/fake-page/
          HTTP/1.1 302 Moved Temporarily
          Date: Fri, 07 Mar 2014 14:35:28 GMT
          Content-Type: text/html
          Content-Length: 161
          Connection: keep-alive
          Location: http://domain.com/404.html
          Server: NetDNA-cache/2.2
          X-Cache: MISS
          
  4. Resulting nginx configuration block

          location / {
                    error_page 404 http://domain.com/404.html;
                    proxy_intercept_errors on;
          ...
          }