SNI, multiple domains, single ip, one SSL domain
However, I need SSL for only one virtual host.
Configuration samples below for my-ssldomain.com (which is supposed to work with SSL) and my-nossldomain.com (one of the other domains which has nothing to do with SSL).
my-ssldomain.com.conf
<virtualhost *:443="">SSLEngine on
ServerName my-ssldomain.com
...</virtualhost>
my-nossldomain.com.conf
<virtualhost *:80="">ServerName my-nossldomain.com
...</virtualhost>
I know that additional IP would solve this problem but I am trying to find single IP solution if any. If it is the only way then I would go that direction. But I have to make sure that Apache couldn't handle this.
Just to note: SSL is a self-signed cert which I am using for client authentication for an in-house web application. It doesn't matter but just in case, this is the setting.
Thank you in advance, for even reading.
6 Replies
Normally I'd say you'd want an additional IP however if you're already using a self-signed cert, you can simply create a vhost for
I actually tried this and created a *.443 virtual host entry for the my-nossldomain.com but it didn't help.
I did following:
<virtualhost *:443="">ServerName my-nossldomain.com
RewriteEngine On
RewriteRule ^/?(.*) http://my-nossldomain.com/$1 [R=301,L]</virtualhost>
But it still takes me to the
Now I wonder if I did something wrong in my configuration in rush. Are you sure that this will actually work? So what I am going to do is to have following in order:
# SSL Domain
<virtualhost *:443="">SSLEngine on
ServerName my-ssldomain.com
...</virtualhost>
# NoSSL domain
<virtualhost *:80="">ServerName my-nossldomain.com
...</virtualhost>
# Redirection for NoSSL
<virtualhost *:443="">ServerName my-nossldomain.com
RewriteEngine On
RewriteRule ^/?(.*) http://my-nossldomain.com/$1 [R=301,L]</virtualhost>
It looks right?
Thank you.
Plus, now I'll have an IP if I need another domain to be SSL. I'll keep noSSL domains in one IP, SSL domains in other IP.
Thank you!
@smozgur:
Decided to use additional IP. Web app already needs to be kind of "isolated", so win-win in this case.
Plus, now I'll have an IP if I need another domain to be SSL. I'll keep noSSL domains in one IP, SSL domains in other IP.
Thank you!
That sounds like a better plan.
Thank you very much, Feliciano!
Feliciano, if you'd like to see my problem kind of started with this