Welcome! Log In Create A New Profile

Advanced

Re: Help with specific redirect to https

Antonio P.P. Almeida
December 12, 2012 11:50AM
> I'm trying to redirect anyURL that contains "UserLogin" (ie: Mediawiki) to
> https. This is what I've tried:
>
> rewrite .*UserLogin.* https://domain.com$request_uri? permanent;
> ----
> rewrite UserLogin https://domain.com$request_uri? permanent;
> ----
> rewrite ^.*UserLogin.*$ https://domain.com$request_uri? permanent;
> ----
> location ~* .*UserLogin.* {
> return 301 https://domain.com$request_uri;
> }
> ----
> location ~ .*UserLogin.* {
> return 301 https://domain.com$request_uri;
> }

At the http level:

map $uri $redirect_https {
default 0;
~^.*UserLogin.*$ 1;
}

Then at the server level do:

if ($redirect_https) {
return 301 https://$host$request_uri;
}

--appa

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

Help with specific redirect to https

Pete Ashdown December 12, 2012 11:14AM

Re: Help with specific redirect to https

Antonio P.P. Almeida December 12, 2012 11:50AM

Re: Help with specific redirect to https

Pete Ashdown December 12, 2012 12:00PM

Re: Help with specific redirect to https

Antonio P.P. Almeida December 12, 2012 01:08PM

Re: Help with specific redirect to https

Pete Ashdown December 12, 2012 02:24PM

Re: Help with specific redirect to https

António P. P. Almeida December 12, 2012 05:32PM

Re: Help with specific redirect to https

Pete Ashdown December 13, 2012 12:06PM

Re: Help with specific redirect to https

Francis Daly December 12, 2012 06:44PM

Re: Help with specific redirect to https

Francis Daly December 12, 2012 12:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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