0

I have a nginx server with the following (simplified) server block:

server {
    listen 80;
    server_name _;

    location / {
        root /var/www/html;
        index index.html;
    }
}

Every domain name that has an A-record to my server has the same website on it.

Question: is it possible to use a "wildcard" SSL certificate (I mean wildcard for all domains, not a wildcard subdomain)? So that all domain names, even new ones added to the group, will have an SSL-connection with the sever?

Let's encrypt is ok, a paid one is also ok (not too expensive).

If there are online tutorials about how to achieve this, please let me know. I'm struggling in Google on how to search for this topic.

Edit: I think I found a possible solution: https://medium.com/@vibhoragrawal/how-to-setup-ssl-on-the-fly-for-multiple-custom-domains-pointing-to-the-same-server-b557fc4df1f9. I will post the results if this works.

Sam Leurs
  • 111
  • 2
  • With wildcard certificates, no. There is an nginx Lua script that automatically creates let's encrypt certificates on the first connection, which should basically do what you want. – Gerald Schneider May 21 '23 at 14:48
  • Thank you for your answer! How can I find this lua script on google? – Sam Leurs May 21 '23 at 14:50
  • Do you mean hosts or subdomains? Wildcard certificate will work for hosts in one domain, but not for subdomains. – Romeo Ninov May 21 '23 at 14:51
  • I think I found a solution: https://medium.com/@vibhoragrawal/how-to-setup-ssl-on-the-fly-for-multiple-custom-domains-pointing-to-the-same-server-b557fc4df1f9. Generating SSL-certificates on the fly. – Sam Leurs May 21 '23 at 14:52
  • The script for creating certificated (for Let's Encrypt/EFF) is here: https://certbot.eff.org/ – Luuk May 21 '23 at 14:54

0 Answers0