Score:0

"wildcard" ssl certificate for all domains pointing to nginx server

in flag

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.

in flag
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.
yesterday avatar
in flag
Thank you for your answer! How can I find this lua script on google?
Romeo Ninov avatar
in flag
Do you mean hosts or subdomains? Wildcard certificate will work for hosts in one domain, but not for subdomains.
yesterday avatar
in flag
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.
uz flag
The script for creating certificated (for Let's Encrypt/EFF) is here: https://certbot.eff.org/
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.