Welcome! Log In Create A New Profile

Advanced

Re: proxy_pass and trailing / decode uri

max
March 12, 2018 04:56AM
Hi,

When you want nginx to replace matching part of the URI with "/",
> it will do so on the decoded/normalized URI, and will re-encode
> special characters in what's left.
>
> If you want nginx to preserve original URI as sent by the client,
> consider using proxy_pass without the URI part. That is,
> instead of
>
> proxy_pass http://127.0.0.1:82/;
>
> use
>
> proxy_pass http://127.0.0.1:82;
>
> Note no trailing "/". This way the original URI as sent by the
> client will be preserved without any modifications.
>


Thank you for your answer but it is not correct for location different than
'/'. With your proposal, targeting http://domain1.com/api/foo/bar, socket
on port 82 receives: /api/foo/bar. I guess the only way to remove the /api
part is "rewrite" and involves re-encoding...

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

proxy_pass and trailing / decode uri

max March 08, 2018 04:36PM

Re: proxy_pass and trailing / decode uri

Maxim Dounin March 11, 2018 06:28PM

Re: proxy_pass and trailing / decode uri

max March 12, 2018 04:56AM

Re: proxy_pass and trailing / decode uri

max March 12, 2018 05:00AM

Re: proxy_pass and trailing / decode uri

Maxim Dounin March 12, 2018 08:30AM

Re: proxy_pass and trailing / decode uri

max March 12, 2018 08:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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