How to redirect all SSL traffic?
Glen Lumanau
glen at lumanau.web.id
Mon Nov 9 01:25:52 MSK 2009
Ok ill try that.
Why we can't use the same method for port 443?
------Original Message------
From: Alex Hunsaker
To: glen at lumanau.web.id
Cc: nginx at sysoev.ru
Subject: Re: How to redirect all SSL traffic?
Sent: Nov 9, 2009 5:10 AM
On Sun, Nov 8, 2009 at 03:31, Glen Lumanau <glen at lumanau.web.id> wrote:
[ please keep the mailing list cc'ed ]
> Try port 80...
>> On port 80 is sucessfull. Is there any way to do that on port 443?
Ahh ok so you want http://mydomain.com and https://mydomain.com to go
to https://www.mydomain.com.
Sure something like:
server {
listen 80;
rewrite (^.*) https://www.mydomain.com$1 permanent;
}
# config for https://www.mydomain.com
server {
listen 443;
...
if ($host !~ www\.mydomain\.com) {
rewrite ^(.*) https://www.mydomain.com$1 permanent;
}
}
Best Regards,
Glen Lumanau
More information about the nginx
mailing list