restricting the http method for all location and enable the same for

R
  • 24 Jul '23
Hi Team,

We are looking for restricting the http method for all location  and enable the same for specific location, I found the way in Apache http server, I am unable to find the same in NGINX, can you please guide me here, how to achieve it.

Code snippet works in Apache Http server:
<LocationMatch "/ABCD/*">
                AllowMethods GET HEAD POST PUT DELETE /*disable the methods*/
           </LocationMatch>

/*enable same method using below code*/
<LocationMatch "/Windchill/oauth/servlet/odata/PTC/GetCSRFToken()">
             AllowMethods GET HEAD POST PUT DELETE OPTIONS
           </LocationMatch>

Thanks and Regards,
Rajendra Rathore
9922701491

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20230724/60330c68/attachment.htm>