Welcome! Log In Create A New Profile

Advanced

Why nginx loses GET parameters in request_uri?

Posted by alvassin 
Why nginx loses GET parameters in request_uri?
August 17, 2015 10:36AM
I need to add "/#" before every request in nginx (angular application with old browsers support).

I used following nginx rule to force hash symbol before $request_uri, but it loses everything after & char (returns only first GET parameter):

location ~* ^/[a-z0-9_\-\/]+$ {
return 301 /#$request_uri;
}

E.g. if i will request http://example.com/?p1=v1&p2=v2 i will get redirect to http://example.com/#/?p1=v1. p2 parameter is lost.

But following codel outputs $request_uri with all parameters:

location ~* ^/[a-z0-9_\-\/]+$ {
echo $request_uri;
}

Is it a bug? How this could be workarounded? I need all GET parameters.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 211
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready