Welcome! Log In Create A New Profile

Advanced

Redirect SSL with load balanced cluster

Posted by JiveMasterT 
Redirect SSL with load balanced cluster
February 15, 2011 10:03AM
I have a cluster of servers each serving up my application through Nginx on CentOS. I installed using the yum repositories so I don't have SNI enabled...

I need to redirect any requests that go to https://domain.com to https://www.domain.com because the www.domain.com URL has an extended validation certificate. I also have a wildcard certificate available for my use.

Here's a sample of the way it currently sits...
[code]
server {
listen 443;
server_name domain.com;
ssl on;
ssl_certificate /etc/ssl/_.domain.com.combined.crt;
ssl_certificate_key /etc/ssl/_.domain.com.key;
rewrite ^/(.*) https://www.domain.com/$1 permanent;
}

server {
listen 443;
server_name www.domain.com ~web\d.domain.com;
ssl on;
ssl_certificate /etc/ssl/www.domain.com.combined.crt;
ssl_certificate_key /etc/ssl/www.domain.com.key;
# Normal server stuff here
}
[/code]

This works, except that any requests that actually arrive at https://www.domain.com are now using the wildcard certificate.

With Apache, all I had to do was tell it to re-write any requests that went to https://domain.com to https://www.domain.com and it took care of things for me without any additional certificates or worries. I'm trying to figure out how to get this behavior with Nginx. Does it make the most sense to go build my own version of Nginx with SNI or is there an easier way to go about this?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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