Welcome! Log In Create A New Profile

Advanced

Re: proxy_pass with trailing slash issue

Maxim Dounin
May 17, 2012 03:10PM
Hello!

On Thu, May 17, 2012 at 06:39:15PM +0000, John Moore wrote:

> I'm using nginx (0.7.65) as a reverse proxy in front of a bunch of
> Tomcat instances. A couple of years ago, following Igor's suggestions on
> the mailing list, I made a minor change to the configuration to deal
> with a problem with encoding/decoding with some URLs proxied to Tomcat.
> I appended a forward slash to the proxy_pass, so instead of having this:
>
> proxy_pass http://backend;
>
> I had this:
>
> proxy_pass http://backend/;
>
> It fixed the problem. But it had the side-effect (at least I assume it
> was this) of inserting an extraneous leading slash into the proxied URL,
> so that the requests ending up at Tomcat are like this:
>
> "GET //whatever"
>
> It's not actually breaking anything that I know about at the moment, but
> it's clearly wrong and I'd like to fix it. How do I change my config so
> that I get the benefits of the trailing slash with proxy_pass without
> having the extraneous leading slash in the proxied request?

With

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

there shouldn't be any extra slashes, even in 0.7.65 which is
rather old (and it may be good idea to upgrade it anyway). Could
you please provide full config and some logs which show the
problem?

Maxim Dounin

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

proxy_pass with trailing slash issue

J2R May 17, 2012 02:40PM

Re: proxy_pass with trailing slash issue

Maxim Dounin May 17, 2012 03:10PM

Re: proxy_pass with trailing slash issue

John Moore May 17, 2012 03:42PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 249
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