Welcome! Log In Create A New Profile

Advanced

Should it be "if ( $request_method !~ ^(GET...)" or "limit_except GET..." ?

Mark Alan
January 23, 2013 06:58AM
Hello,


Can anybody tell me if the bellow constructs are equivalent?

In case of a dozen or so 'location', would it still be better to have a
limit_except for each location or, in that case, would it be better to
have a server level single 'if ( $request_method...' ?

server {
...
if ( $request_method !~ ^(?:GET|HEAD|POST)$ ) { return 444; }
...

server {
...
location / {
limit_except GET HEAD POST { deny all; }
...

Thank you,
Mark

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Should it be "if ( $request_method !~ ^(GET...)" or "limit_except GET..." ?

Mark Alan January 23, 2013 06:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 182
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready