Request Method Using Mixed case letters.

sanjay9999 nginx-forum at forum.nginx.org
Tue Jan 12 09:21:17 UTC 2021


Example used in testcase
request method = "POSTsss" 

I would like to allow GET / POST / DELETE methods only. otherwise send 501
response.
if ($request_method !~* ^(GET|DELETE|POST)$ ) {
  return 501 '{ "ver": "1.1.2", "txnid": "", "timestamp": "", "errorCode":
"NotImplemented", "errorMsg": "Request Method is not implemented"}';
}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,290451,290452#msg-290452



More information about the nginx mailing list