1

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;

        }
}

benji
  • 13
  • 2

1 Answers1

0

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

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • 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 it just domainname. – benji Oct 30 '22 at 15:31