Skip to content

Instantly share code, notes, and snippets.

@perusio
Last active August 29, 2015 14:27
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 perusio/5093bf58def0a1eacfad to your computer and use it in GitHub Desktop.
Save perusio/5093bf58def0a1eacfad to your computer and use it in GitHub Desktop.
Allow PUT and DELETE in specific places.
# -*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*-
### This file contains a map directive that is used to block the
### invocation of HTTP methods. Out of the box it allows for HEAD, GET and POST.
map $request_method $simple_not_allowed_method {
default 1;
GET 0;
HEAD 0;
POST 0;
}
## This allows for the use of PUT and DELETE in the /foobar URI.
map $request_uri+$request_method $not_allowed_method {
default $simple_not_not_allowed_method;
/foobar+PUT 0;
/foobar+DELETE 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment