<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>we'd like to add onto the query string an identifier of the nginx server<br><br>something like:<br><br><span class="Apple-tab-span" style="white-space: pre; "> </span>return 301 <a href="https://$host$request_uri?source=server1">https://$host$request_uri?source=server1</a> ;<br><br>the problem is that we can't figure out how to make this work correctly when the url already contains query strings.<br><br><br>Example:<br><span class="Apple-tab-span" style="white-space: pre; "> </span>return 301 <a href="https://$host$request_uri?source=server1">https://$host$request_uri?source=server1</a> ;<br><span class="Apple-tab-span" style="white-space: pre; "> </span>Good!<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>in /foo.bar <br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>out /foo.bar?source=server1<br><span class="Apple-tab-span" style="white-space: pre; "> </span>Bad!<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>in /foo.bar?a=1<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>out /foo.bar?a=1?source=server1<br><br>How can we get this?<br><div><span class="Apple-tab-span" style="white-space: pre; "><span class="Apple-style-span" style="white-space: normal;"><br></span> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>in /foo.bar <br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>out /foo.bar?source=server1<br><br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>in /foo.bar?a=1<br><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>out /foo.bar?a=1&source=server1<br><br><br></div></body></html>