# Limit Available Methods

**URL:** <https://www.ruby-forum.com/t/limit-available-methods/217419>\
**Category:** NGINX\
**Created:** [March 1, 2012, 11:19am UTC](https://www.ruby-forum.com/t/limit-available-methods/217419 "2012-03-01T11:19:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 1, 2012, 11:19am UTC](https://www.ruby-forum.com/t/limit-available-methods/217419/1 "2012-03-01T11:19:17Z")

</div>

Want to limit OPTIONS and TRACE method from nginx server

Referred following post( section #11)  
Disable certain HTTP methods at global level, below article will help  
us to restrict at server block level  
\*  
[http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html](http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html)

We want to disable at global level because our configuration consist of  
so many server blocks

Any help appreciated

Regards  
Kamalakar

Posted at Nginx Forum:

> **[Limit Available Methods](https://forum.nginx.org/read.php?2,223208,223208#msg-223208)**
>
> Want to limit OPTIONS and TRACE method from nginx server Referred following post( section #11) Disable certain HTTP methods at global level, below article will help us to restrict at server block level \*...

---

<div class="post-metadata">

**Author:** ![kamalakarv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@kamalakarv](https://www.ruby-forum.com/u/kamalakarv)\
**Post date:** [March 1, 2012, 11:40am UTC](https://www.ruby-forum.com/t/limit-available-methods/217419/2 "2012-03-01T11:40:22Z")

</div>

On Thu, Mar 01, 2012 at 05:18:48AM -0500, kamalakarv wrote:

> Want to limit OPTIONS and TRACE method from nginx server
> 
> Referred following post( section #11)  
> Disable certain HTTP methods at global level, below article will help  
> us to restrict at server block level  
> \*  
> [http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html](http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html)
> 
> We want to disable at global level because our configuration consist of  
> so many server blocks

The ngx\_http\_dav\_module module processes HTTP and WebDAV methods PUT,  
DELETE,  
MKCOL, COPY, and MOVE, i.e. no OPTIONS and TRACE methods.  
You may specify WebDAV methods with dav\_methods directive, see  
[Module ngx\_http\_dav\_module](http://nginx.org/en/docs/http/ngx_http_dav_module.html) for details.

AFAIK OPTIONS method available with dav\_ext third-party module

> **[GitHub - arut/nginx-dav-ext-module: nginx WebDAV PROPFIND,OPTIONS,LOCK,UNLOCK support](https://github.com/arut/nginx-dav-ext-module/)**
>
> nginx WebDAV PROPFIND,OPTIONS,LOCK,UNLOCK support

–  
Sergey A. Osokin  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![kamalakarv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/bc8723/32.png) [@kamalakarv](https://www.ruby-forum.com/u/kamalakarv)\
**Post date:** [March 1, 2012, 12:02pm UTC](https://www.ruby-forum.com/t/limit-available-methods/217419/3 "2012-03-01T12:02:42Z")

</div>

Hello!

On Thu, Mar 01, 2012 at 05:18:48AM -0500, kamalakarv wrote:

> Want to limit OPTIONS and TRACE method from nginx server
> 
> Referred following post( section #11)  
> Disable certain HTTP methods at global level, below article will help  
> us to restrict at server block level  
> \*  
> [http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html](http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html)
> 
> We want to disable at global level because our configuration consist of  
> so many server blocks

The TRACE method is always rejected with 405 since nginx 0.5.17.

To disable other methods like OPTIONS (which currently isn’t  
handled by nginx, but may be proxy\_pass’ed somewhere else) you  
have to use either rewrite checks like in the article above or the  
“limit\_expect” directive ([Module ngx\_http\_core\_module](http://nginx.org/r/limit_except)). This  
isn’t possible at global level, though you may use the “include”  
directive ([Core functionality](http://nginx.org/r/include)) to include common  
configuration block into all servers.

Maxim D.
