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

Igor Sysoev is at rambler-co.ru
Wed Nov 4 13:27:16 MSK 2009


On Wed, Nov 04, 2009 at 10:16:14AM +0000, John Moore wrote:

> Igor Sysoev wrote:
> >
> > 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.
> >
> >
> >   
> Thanks. I'm using the upstream module, so what I had was this:
> 
>     proxy_pass         http://backend;
> 
> I changed it to
> 
>     proxy_pass         http://backend/;
> 
> The result was this:
> 
> Starting nginx: 2009/11/04 11:12:12 [emerg] 2272#0: "proxy_pass" may not 
> have URI part in location given by regular expression, or inside named 
> location, or inside the "if" statement, or inside the "limit_except" 
> block in /etc/nginx/proxy.conf:1
> 
> What have I done wrong?

Probably, you set proxy_pass inside "if" block. Could you should this
configuration part ? I think it can be rewritten without "if".


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list