Problem with double slashes in URL when using nginx as proxy

Igor Sysoev igor at sysoev.ru
Fri Sep 10 16:16:20 MSD 2010


On Fri, Sep 10, 2010 at 08:05:13AM -0400, alexk wrote:

> Strange,
> 
> When post is specified in listen directive:
> 
> server {
>     listen 80;
>     ...
> }
> 
> it works well with double slashes.
> 
> But when using domain name in listen directive
> 
> server {
>     listen *****.com;
>     ...
> }
> 
> it removes double slashes.

You probably proxy using

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

You need ot remove the last "/", then nginx will use a client original
request with double slashes:

    location / {
        proxy_pass http://backend;
    }


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



More information about the nginx mailing list