Welcome! Log In Create A New Profile

Advanced

Re: query part included in location match after rewrite (bug or feature?)

Francis Daly
September 13, 2013 09:20AM
On Fri, Sep 13, 2013 at 08:48:55AM -0400, aldem wrote:

Hi there,

> According to documentation, "location" matches only against URI path,
> ignoring query string. However, after "rewrite", when using variables
> containing "?" character (like $request_uri for illustration), query becomes
> part of $uri:

My reading of this is that you must give rewrite an explicit ? to mark
the query string, so a ? within a variable *is* part of $uri if it comes
before a ?. If you want to have your own query string, or to lose the
original query string during the rewrite, you must use an explicit ?.

> So, my question is - is this expected behavior (just undocumented) or is a
> bug? To me it looks like a bug - allowing matching anything past "?" in
> location and making it part of $uri.

? is a valid character in a normalised uri. ? is special in an escaped
uri, since it marks the query string. "rewrite" creates a normalised uri
(at least, when given variables to expand).

I'd say "expected", unless there's an example where "rewrite" does not
create a normalised uri.

f
--
Francis Daly francis@daoine.org

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

query part included in location match after rewrite (bug or feature?)

aldem September 13, 2013 08:48AM

Re: query part included in location match after rewrite (bug or feature?)

Francis Daly September 13, 2013 09:20AM

Re: query part included in location match after rewrite (bug or feature?)

aldem September 13, 2013 09:48AM

Re: query part included in location match after rewrite (bug or feature?)

Francis Daly September 13, 2013 10:28AM

Re: query part included in location match after rewrite (bug or feature?)

aldem September 13, 2013 10:51AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 201
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready