Welcome! Log In Create A New Profile

Advanced

Strange behaviour of %27 encoding in rewrite

aquilinux
November 14, 2018 09:56AM
Hi all,
i'm seeing a strange behaviour in nginx rewrite involving encoded urls for
*%27*
I have this type of rewrite:

rewrite "^/brands/l-oreal$"
> https://somedomain.tld/L%27Or%C3%A9al-Paris/index.html? permanent;
>

That translates to this:


> [~]> curl -kIL https://mydomain.tld/brands/l-oreal
> HTTP/2 301
> server: nginx
> date: Wed, 14 Nov 2018 14:44:21 GMT
> content-type: text/html
> content-length: 178
> *location: https://somedomain.tld/L'Or%C3%A9al-Paris/index.html
> https://somedomain.tld/L'Or%C3%A9al-Paris/index.html*
> strict-transport-security: max-age=15768000; includeSubDomains


If i change %27 to %20 i have:

[~]> curl -kIL https://mydomain.tld/brands/l-oreal
> HTTP/2 301
> server: nginx
> date: Wed, 14 Nov 2018 14:31:09 GMT
> content-type: text/html
> content-length: 178
> *location: https://somedomain.tld/L%20Or%C3%A9al-Paris/index.html
> https://somedomain.tld/L%20Or%C3%A9al-Paris/index.html*
> strict-transport-security: max-age=15768000; includeSubDomains


as expected.

The same strange behaviour applies to *%2C*, that is decoded to "*,*"
instead of being passed unencoded, as expected.
This is driving me nuts, can anyone explain (or fix) this?

Thanks!


--
"Madness, like small fish, runs in hosts, in vast numbers of instances."

Nessuno mi pettina bene come il vento.
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Strange behaviour of %27 encoding in rewrite

aquilinux November 14, 2018 09:56AM

Re: Strange behaviour of %27 encoding in rewrite

Maxim Dounin November 15, 2018 10:56AM

Re: Strange behaviour of %27 encoding in rewrite

aquilinux November 19, 2018 11:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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