I have deployed SSL certificates on various websites however this wildcard SSL certificate is totally new to me. I have question that If I am buying a SSL certificate *.example-private.com
, Will it work for *.staging.example-private.com
Or Do I have to buy a different wild card SSL for staging
site. I am going to implement this on new sites.
I'm trying to accomplish three things:
- Map traffic, by subdomain, to one of several applications on different ports.
- If subdomain isn't recognized, redirect to www.
- Require HTTPS on all subdomains.
My nginx configuration so far is:
map $subdomain $subdomain_port {
default 8000;
www 8000;
subdomain1 8001;
subdomain2 8002;
subdomain3 8003;
}
server {
listen 80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name ~^(?P<subdomain>.+?)\.mydomain\.com$;
ssl_certificate <cert>;
ssl_certificate_key <key>;
location / {
# ... various proxy headers, then ...
proxy_pass http://127.0.0.1:$subdomain_port;
proxy_redirect off;
}
}
This almost works (it accomplishes #1 and #3), but instead of redirecting foo.mydomain.com
to www.mydomain.com
, it just serves the www
content without redirecting. I'm not sure how to redirect un-mapped subdomains without splitting the whole thing into separate server
blocks, which I'd really rather not do.
Is there a way to redirect all subdomains not explicitly mentioned in the map to www
?
Is it possible to create a wildcard host record for a sub-subdomain ie *.foo.example.com?
I have the following in my Apache config:
<VirtualHost *:80>
VirtualDocumentRoot /var/www/hosts/%0
ServerAlias *.test.galapagos.office
</VirtualHost>
In /var/www/hosts, I have a directory called jason.test.galapagos.office and one called bill.test.galapagos.office. If I go to jason.test.galapagos.office in a browser, I get what I expect to see. Same with bill. In other words, everything is working perfectly.
However, I'm not quite satisfied with what's going on. Instead of /var/www/hosts/jason.test.galapagos.office and /var/www/hosts/bill.test.galapagos.office/, I'd like /home/jason/web and /home/bill/web.
How can I tell Apache to map to those subdirectories instead?
Thanks, Jason
Is there a registar that offers SSL certificates for:
..domain.com
or
something_fixed.*.domain.com?
--
M.