rewrite last using variable

Ingo Schmidt lists at der-ingo.de
Mon Oct 28 08:36:20 UTC 2013


Hi!

> I believe it is intended to be "no", for internal rewrites at least.
Hmm, any reason why it might be intended?
Also, it would be nice if the docs could mention this, because I find it 
unintuitive, if rewrite behaves differently depending on the rewrite type.

> You can do something like set $var "/url"; set $vararg "par=val"; 
> rewrite ^ $var?$vararg last;
Well, in my case that is exactly what I am trying to avoid, because my 
variable is set in a map and I would have to create two maps then, one 
with the URLs, the other with arguments.
And, as you already pointed out, sometimes the argument is optional.

Hmm, but it looks like this is my only option right now.
Anyway, thanks for your answer!

Cheers, Ingo =;->



More information about the nginx mailing list