Score:1

Configuring SSL with Nginx on Ubuntu Server

sa flag

I have been following some tutorials online, and I have gotten my flask app up and running. I have added domain names, and they work correctly. However, now im trying to use Certbot to get a SSL certificate for nginx.

This is the command since I already have created the certificate.


certbot install --cert-name domainname.com

I keep getting the error:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Deploying certificate
Could not install certificate
Could not automatically find a matching server block for wehavetheleads.org. Set the `server_name` directive to use the Nginx installer.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

This is my etc/nginx/sites_enabled config file:

server {
        listen 80;
        server_name <public-server-ip>;

        location / {
                proxy_pass http://127.0.0.1:8000;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        }
}

Score:0
us flag

Your server_name needs to contain the domain name of your service, not IP address.

benji avatar
sa flag
Thank you this worked. I want to also be clear to anybody who reads this as well, remember to remove the arrows as well. So it's not <domainname> it just domainname.
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.