nginx rewrites $request_method on error

Yichun Zhang (agentzh) agentzh at gmail.com
Thu May 15 19:20:46 UTC 2014


Hello!

On Wed, May 14, 2014 at 11:19 PM, kay wrote:
> http {
>         error_page 405 /error.html;
>         error_page 400 /error.html;
>         error_page 403 /error.html;
>

Okay, I can reproduce your request hang on my side now and I see what
is going on here.

Basically the 405 error is thrown so early in the processing flow of
your TRACE request within the nginx core that you cannot do
complicated processing like initiating a subrequest in your error page
target (because the request state has not been fully initialized).

Several suggestions:

1. prevent complicated logic (like subrequests and etc) in your error
page target location,

2. avoid using error_page directives in big scope as server {} or even
http {} because *every* location will inherit your error_page
configurations, including your location /memc for subrequests, which
can create an access dead loop.

Regards,
-agentzh



More information about the nginx mailing list