Created
September 2, 2014 20:20
-
-
Save baskaran-md/e46cc25ccfac83f153bb to your computer and use it in GitHub Desktop.
NginX allow POST on static pages.
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
# ... | |
server { | |
listen 80; | |
server_name localhost; | |
location / { | |
root html; | |
index index.html index.htm; | |
} | |
error_page 404 /404.html; | |
error_page 403 /403.html; | |
# To allow POST on static pages | |
error_page 405 =200 $uri; | |
# ... | |
} | |
# ... |
Doesn't it mean it allows any method? How can I ask Nginx to allow get and post, but forbid others?
@kolayne
You can add this block in the nginx.conf
to allow only get & post.
limit_except GET POST {
deny all;
}
@baskaran-md
access_log $request_body is null
That works Thanks :)
That works! Thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it works for me perfectly.