| From | Sent On | Attachments |
|---|---|---|
| Rt Ibmer | May 13, 2008 2:26 pm | |
| Rafał Zawadzki | May 13, 2008 3:43 pm | |
| Calomel | May 13, 2008 6:04 pm | |
| Rt Ibmer | May 13, 2008 8:44 pm | |
| Jay Reitz | May 13, 2008 9:45 pm | |
| Igor Sysoev | May 14, 2008 2:53 am | |
| Rt Ibmer | May 19, 2008 7:50 pm | |
| Calomel | May 20, 2008 10:02 am | |
| Rt Ibmer | May 20, 2008 11:47 am | |
| Rt Ibmer | May 20, 2008 8:02 pm | |
| Calomel | May 21, 2008 9:33 am | |
| Jonathan Vanasco | Jul 24, 2009 11:52 am | |
| peacock | Jul 28, 2009 8:49 pm | |
| Igor Sysoev | Jul 29, 2009 1:32 am | .Other |
| peacock | Jul 29, 2009 5:24 am | |
| peacock | Jul 29, 2009 5:24 am |
| Subject: | Re: How to block POST requests? | |
|---|---|---|
| From: | Rt Ibmer (rtib...@public.gmane.org) | |
| Date: | May 19, 2008 7:50:17 pm | |
| List: | ru.sysoev.nginx | |
You can also use regular expressions for a bit more flexibility. This way you can explicitly accept only the request methods you allow and return the error code of your choosing.
## Only allow GET and HEAD request methods if ($request_method !~ ^(GET|HEAD)$ ) { return 444; }
Hello - I am using the latest nginx 6. When I try to do as you say above I am
getting the error in the nginx error file: unknown directive "if" in xyz.log
I am using your exact block as above and from your web page, like this:
if ($request_method !~ ^(GET|HEAD)$ ) { return 444; }
I have tried this within the main server directive as well as from within
location directives, but always get this error. Obviously I am missing
something? Thanks.






.Other