Last active
August 29, 2015 14:27
-
-
Save perusio/5093bf58def0a1eacfad to your computer and use it in GitHub Desktop.
Allow PUT and DELETE in specific places.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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