Welcome! Log In Create A New Profile

Advanced

X-Accel-Redirect bracket character not url encoded (1.9.4)

Posted by isuraed 
X-Accel-Redirect bracket character not url encoded (1.9.4)
January 06, 2016 06:52PM
Hello,

I'm noticing an issue where the square bracket characters are not url encoded when passing to the upstream server. My config is

upstream avatar {
server localhost:8879;
}

location /avatar-internal/ {
internal;
proxy_pass http://avatar/;
}

I'm passing a url encoded value in the X-Accel-Redirect header,
e.g. /avatar-internal/file%5D.jpg?x=1

but nginx sends the url
file].jpg?x=1

instead of the correct
file%5D.jpg?x=1

It does not re-encode [ and ] characters. But it seems to re-encode other special characters like ? and #. I'm using version 1.9.4. This seems like a bug.



Edited 1 time(s). Last edit at 01/06/2016 06:53PM by isuraed.
Re: X-Accel-Redirect bracket character not url encoded (1.9.4)
January 06, 2016 06:57PM
Another inconsistency I see is if I pass an unescaped URL in the header, then special characters are escaped EXCEPT for square brackets.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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