Welcome! Log In Create A New Profile

Advanced

Re: Query strings duplicating on 301 redirect

Richard Stanway
May 05, 2014 05:10PM
Just a note, I think the preferred way to do this is with "return". It's
much simpler (no rewrite / PCRE overhead):

location / {
if ($scheme = http) {
return 301 https://$http_host$request_uri;
}


On Mon, May 5, 2014 at 10:54 PM, Justin Dorfman <jdorfman@netdna.com> wrote:

> Thanks Francis, worked perfectly.
>
>
> Regards,
>
> Justin Dorfman http://www.twitter.com/jdorfman
>
> Director of Developer Relations
> MaxCDN http://twitter.com/MaxCDNDeveloper
>
> Email / IM: jdorfman@maxcdn.com
> Mobile: 818.485.1458
> Twitter: @jdorfman http://www.twitter.com/jdorfman
>
>
> On Mon, May 5, 2014 at 1:11 PM, Francis Daly <francis@daoine.org> wrote:
>
>> On Mon, May 05, 2014 at 12:14:48PM -0700, Justin Dorfman wrote:
>>
>> Hi there,
>>
>> > I am trying to redirect (301) all HTTP request to TLS (HTTPS) and I keep
>> > getting duplicate query strings added to the uri. e.g.:
>>
>> http://nginx.org/r/rewrite
>>
>> Second last paragraph looks like it should fix it.
>>
>> f
>> --
>> Francis Daly francis@daoine.org
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Query strings duplicating on 301 redirect

Justin Dorfman May 05, 2014 03:16PM

Re: Query strings duplicating on 301 redirect

Francis Daly May 05, 2014 04:12PM

Re: Query strings duplicating on 301 redirect

Justin Dorfman May 05, 2014 04:56PM

Re: Query strings duplicating on 301 redirect

Richard Stanway May 05, 2014 05:10PM

Re: Query strings duplicating on 301 redirect

Justin Dorfman May 05, 2014 07:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 160
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