Welcome! Log In Create A New Profile

Advanced

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

November 04, 2009 05:00AM
On Wed, Nov 04, 2009 at 09:43:14AM +0000, John Moore wrote:

> 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?

If you set

location / {
proxy_pass http://tomcat;
}

then nginx passes a unchanged original client request, however, if you set

location / {
proxy_pass http://tomcat/;
}

then nginx passes unescaped and then escaped again request,
So "+" and "/" will be unescaped in this case.


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

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

John Moore November 03, 2009 03:14PM

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

Igor Sysoev November 03, 2009 04:18PM

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

John Moore November 03, 2009 04:50PM

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

Igor Sysoev November 03, 2009 04:56PM

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

John Moore November 03, 2009 05:02PM

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

Igor Sysoev November 03, 2009 05:20PM

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

John Moore November 04, 2009 04:48AM

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

Igor Sysoev November 04, 2009 05:00AM

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

John Moore November 04, 2009 05:20AM

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

Igor Sysoev November 04, 2009 05:30AM

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

John Moore November 04, 2009 05:58AM

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

Igor Sysoev November 04, 2009 06:18AM

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

John Moore November 04, 2009 06:50AM

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

Igor Sysoev November 04, 2009 07:00AM

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

John Moore November 04, 2009 07:20AM

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

Igor Sysoev November 04, 2009 07:38AM

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

John Moore November 04, 2009 07:30AM

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

Igor Sysoev November 04, 2009 07:38AM

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

John Moore November 04, 2009 08:18AM

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

Igor Sysoev November 04, 2009 08:44AM

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

John Moore November 04, 2009 08:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 198
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready