1. Background
    Sometimes it can be useful to return a specific status code for certain asset or path on the CDN. The example below shows a setup to show HTTP status code 404 on path /example/. This condition takes server protocol into consideration and if it is “HTTP/1.1” the CDN will apply the defined status code for the desired asset(s)
  2. Rule
  3. Curl asset without rule

    ~$ curl -I http://foo.bar.netdna-cdn.com/example/
    HTTP/1.1 200 OK
    Date: Sun, 25 Aug 2013 21:12:00 GMT
    Content-Type: text/html; charset=UTF-8
    Content-Length: 12345
    Connection: keep-alive
    Accept-Ranges: none
    Vary: Accept-Encoding,Cookie
    Pragma: public
    Cache-Control: max-age=0, no-cache, must-revalidate, proxy-revalidate
    Server: NetDNA-cache/2.2
    X-Cache: MISS
  4. Curl asset with rule

    ~$ curl -I http://foo.bar.netdna-cdn.com/example/
    HTTP/1.1 404 Not Found
    Date: Sun, 25 Aug 2013 21:11:56 GMT
    Content-Type: text/html
    Content-Length: 169
    Connection: keep-alive
    Server: NetDNA-cache/2.2
  5. Resulting Nginx Configuration Block

    location ^~ /example/ {
          if ($server_protocol = "HTTP/1.1") {
               return 404;