I own the domains
example.com, .com.au, .net, .net.au, ... (8 in total).
I want all of these TLD's to 301 redirect to the secure .com domain
https://www.example.com
I have it working using Nginx for all HTTP requests but not all HTTPS.
I have installed a SSL certificate for https://www.example.com
and this works for www and non-www without any security warnings (as expected).
When browsing to say http://example.net
I get redirected to https://www.example.com
without security warnings. However, when browsing to https://example.net
I get the dreaded security warning.
Now I assume this is due to me only owning the .com SSL certificate and not for the other TLDs. Also, all sites are hosted on the same server/ip address, thus the .com certificate being returned for other TLDs.
DNS A records for all domains point to the single IP address of my Nginx server.
From what I have read and understood, I think I need an IP address and SSL certificate for each TLD I own. This seems like overkill for a simple redirect.
Is there any Nginx or DNS trickery I can use to avoid the standard security warnings for the OTHER (non .com TLD's) without having to fork out for more IP addresses and SSL certificates?
I thought I better ask the brains trust before I go ahead and purchase all the required certs etc.
Below is my Nginx config:
server { # redirect/catch all block
listen 80;
listen 443;
server_name _ .example.com .example.com.au .example.net .example.net.au;
return 301 https://www.example.com$request_uri;
}
server {
listen 443 ssl default_server; # Secure default server block
server_name www.example.com;
root /srv/www/example.com/public_html;
index index.html index.htm;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
# ... rest of config
}