Why does this URL result in a 400 (Bad Request) error?

John Moore grails at jmsd.co.uk
Wed Nov 4 12:43:14 MSK 2009


Igor Sysoev wrote:
> On Tue, Nov 03, 2009 at 09:57:16PM +0000, John Moore wrote:
>
>   
>> Igor Sysoev wrote:
>>     
>>> You may try to set error_log to info level to see 400 error
>>> reason.
>>>
>>>   
>>>       
>> Having tried this, nothing gets written to the error log when the 400 
>> error is returned.
>>     
>
> Is this URL is proxied ? What signature do you see in 400 message ?
>
>
>   
Igor, really sorry to have wasted your time. The problem turns out not 
to be in nginx at all. Yes, nginx is acting as a reverse proxy, in front 
of Tomcat, and it is evidently Tomcat which is returning the 400 error. 
The reason I didn't spot this is that there is no sign of this request 
at all in the Tomcat logs, it's as if the request never got there. The 
only way I could tell was by the fact that there was a specific response 
header which could only have come from Tomcat.

So, that brings me on to another question. Can I use nginx to correct 
the URL, so that Tomcat doesn't choke on it? That is, can I use some 
rewrite trickery to URL decode part of the URL, so that

    _ais_JEzKjKps%2B0%2FAynL0G17OWg?

becomes

    _ais_JEzKjKps+0/AynL0G17OWg?

JM





More information about the nginx mailing list