Welcome! Log In Create A New Profile

Advanced

Re: proper way to redirect from http to https w/query string notifier

Francis Daly
March 24, 2015 03:28PM
On Wed, Mar 25, 2015 at 02:50:29AM +0900, Edho Arief wrote:
> On Wed, Mar 25, 2015 at 2:32 AM, Francis Daly <francis@daoine.org> 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
> >
> > 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
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.

Thanks,

f
--
Francis Daly francis@daoine.org

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

proper way to redirect from http to https w/query string notifier

Jonathan Vanasco March 24, 2015 11:36AM

Re: proper way to redirect from http to https w/query string notifier

Francis Daly March 24, 2015 01:34PM

Re: proper way to redirect from http to https w/query string notifier

Edho Arief March 24, 2015 01:52PM

Re: proper way to redirect from http to https w/query string notifier

Francis Daly March 24, 2015 03:28PM

Re: proper way to redirect from http to https w/query string notifier

Jonathan Vanasco March 24, 2015 06:26PM

Re: proper way to redirect from http to https w/query string notifier

Gena Makhomed March 24, 2015 02:12PM

Re: proper way to redirect from http to https w/query string notifier

Jonathan Vanasco March 24, 2015 06:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 163
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready