Running certbot on lightsail causes 404 error on server IP

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. |, so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

I ran this command: sudo certbot --nginx
sudo systemctl reload nginx

It produced this output:

My web server is (include version): nginx 1.18.0

The operating system my web server runs on is (include version): ubuntu 20.04

My hosting provider, if applicable, is: AWS lightsail

I can login to a root shell on my machine (yes or no, or I don't know): I don't know

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): 1.21.0

I've had this happen twice with different lightsail instances. I get "ERR_CONNECTION_TIMED_OUT" in browse when I go to and I get a 404 when I go to the IP. I have made the minimum changes to the default nginx file. Same issue when I tried this with apache2 running. Any suggestions?

@virtualpilotlight Welcome to the community.

Your nginx server for redirects all requests to https. Unless you made self-signed certs nginx will not yet work with https. I do not see a port 443 open for https on your Lightsail instance - only 22 and 80.

Your server for is configured differently. While this is technically allowed, it is not usually what people want.

Would you post the results of this command: sudo nginx -T
Mark the output as pre-formatted text on the formatting menu (or Ctrl-E)

1 Like

Thank you so much for taking a look! There was an additional firewall setting on the AWS console that you can't get to from command line. I will be trying again, with the right ports open.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.