i need to redirecting from http to https, and append a “source”
attribute for tracking (we’re trying to figure out how the wrong
requests are coming in)
I’m just wondering if there is a more appropriate way
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
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
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:
Hi there,
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
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
that point.
One possible solution would be just $host$uri?source=server1&$args
<note: untested>
That will work in the common case, but $uri has been percent-unescaped
so may not be suitable to send as-is.
Probably you can do such tracking just looking at Referer request header
Long story short - we actually are doing that. This is just to get
stats into the HTTPS log analyzer, which is a different system and much
easier for us to deploy changes to.
i need to redirecting from http to https,
and append a “source” attribute for tracking
(we’re trying to figure out how the wrong requests are coming in)
Probably you can do such tracking just looking at Referer request header
this seems to work:
if ($query_string){
return 301 https://$host$request_uri&source=server1 ;
}
return 301 https://$host$request_uri?source=server1 ;
I’m just wondering if there is a more appropriate way
Yes, you can use $uri variable and rewrite directive for this: