Should we use "if ( $request_method." or "limit_except."?

Hello list,

Can anybody tell me if the bellow constructs are equivalent?

server {

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

server {

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

And, if they are equivalent, in the case of having multiple locations,
is it still better to have a limit_except for each location? Or, in
this case is it better to have a single “if ( $request_method …” at
server level ?

Thank you,
Mark

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs