Important note

The EdgeRules feature is available only on Enterprise plans.

Using the “$request_method” Nginx variable, we want to filter requests by method and only allow GET requests:

Nginx configuration block

location / {
        if ($request_method != GET) {                                  
            return 403;
        }
…
}

CURL – GET request

curl -v http://cdn.domain.com/example.html | grep 'HTTP'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0< HTTP/1.1 200 OK

CURL - HEAD request

curl -I http://cdn.domain.com/example.html
HTTP/1.1 403 Forbidden
Date: Sun, 08 Mar 2015 00:54:32 GMT
Content-Type: text/html
Content-Length: 168
Connection: keep-alive
Server: NetDNA-cache/2.2