Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

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

$
0
0
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

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>