How to solve the problem of "405 not allowed"?

Maxim Dounin mdounin at mdounin.ru
Sat Jan 30 01:12:45 MSK 2010


Hello!

On Fri, Jan 29, 2010 at 11:41:43AM -0500, kleinchris wrote:

> Can't edit my post...
> Here is a debug log, when i do it like this:
> error_page 405 =200 @405;
>         location = @405 {
>                 root /var/www/vhosts/soulreafer;
>         }

This will return internal 405 error page, as 

1. you are serving request by static module again;

2. error_page to named location doesn't change request method.

Try this instead:

    error_page 405 = $uri;

This way request method will be changed to GET, and the same uri 
will be used to serve it.

> http://nopaste.info/5cf44ab3b1.html

This log doesn't shows any problems, and it's not even for POST 
request.  Instead it shows perfectly ok GET request (returning 304 
not modified, as request includes If-Modified-Since).

Maxim Dounin



More information about the nginx mailing list