On Wed, Mar 25, 2015 at 02:50:29AM +0900, Edho A. wrote:
On Wed, Mar 25, 2015 at 2:32 AM, Francis D. [email protected] wrote:
If your backend will accept /request?source=server1 and
/request?&source=server1 as being equivalent, then you could use the
$is_args variable and just always
return 301 https://$host$request_uri$is_args&source=server1;
that looks wrong since when there’s argument:
Ah, yes, you are correct - I had it backwards.
I guess one could set something using “map” to be “?” if $is_args is
empty and “&” if $is_args is ?, and build a correct “return” line from
that – but the original “if ($query_string)” is probably simpler at
One possible solution would be just
That will work in the common case, but $uri has been percent-unescaped
so may not be suitable to send as-is.
Francis D. [email protected]