Welcome! Log In Create A New Profile

Advanced

Re: Getting rewritten and encoded/escaped url in nginx module

Maxim Dounin
June 04, 2014 11:06AM
Hello!

On Tue, Jun 03, 2014 at 02:08:36PM -0700, Jayadev C wrote:

> The problem is ngx_http_proxy doesn't do that either, once
> rewrite is applied the url remains decoded (or I am not reading
> the code correctly).

The proxy does ngx_escape_uri() if URI was rewritten. It has to,
as unencoded URI can't be used in a HTTP request. Take a look at
the ngx_http_proxy_create_request() function as previously
suggested.

> In fact escaping uri back is a bit tricky
> since you have to split the rewritten url to segments and apply
> encoding again (which would require looking at the original url
> to know the correct number of '/'s).

As long as there were encoded slashes, the encoding of these
slashes will be lost if URI was rewritten. This is the expected
behaviour.

--
Maxim Dounin
http://nginx.org/

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

Getting rewritten and encoded/escaped url in nginx module

Jayadev C June 03, 2014 12:44PM

Re: Getting rewritten and encoded/escaped url in nginx module

B.R. June 03, 2014 01:12PM

Re: Getting rewritten and encoded/escaped url in nginx module

Maxim Dounin June 03, 2014 01:18PM

Re: Getting rewritten and encoded/escaped url in nginx module

Jayadev C June 03, 2014 05:10PM

Re: Getting rewritten and encoded/escaped url in nginx module

Maxim Dounin June 04, 2014 11:06AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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