Unable to connect to server after certbot installation

Hi, so I was able to reach my site before running the certbot automated installation but now I’m unable to reach the server. I’m redirecting http traffic and have allowed port 443 with ufw. Not sure what else to try.

My domain is: dadjokedepot.com

My web server is (include version): nginx 1.14

The operating system my web server runs on is (include version): ubuntu 18.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): yes

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

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

Here is my nginx site config file

server {
    server_name dadjokedepot.com www.dadjokedepot.com;
    location /static {
        alias /home/ubuntu/Flask-Blog/dadjokedepot/static;
    }
    location / {
        proxy_pass http://localhost:8000;
        include /etc/nginx/proxy_params;
        proxy_redirect off;
    }    
    listen 443 ssl; # managed by Certbot    
    ssl_certificate /etc/letsencrypt/live/www.dadjokedepot.com/fullchain.pem; # managed by Certbot    
    ssl_certificate_key /etc/letsencrypt/live/www.dadjokedepot.com/privkey.pem; # managed by Certbot   
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot    
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {    
    if ($host = www.dadjokedepot.com) {      
        return 301 https://$host$request_uri;    
    } # managed by Certbot    
    if ($host = dadjokedepot.com) {        
        return 301 https://$host$request_uri;    
    } # managed by Certbot    
    listen 80;    
    server_name dadjokedepot.com www.dadjokedepot.com;    
    return 404; # managed by Certbot
}
1 Like

Your webserver itself is working fine. The redirect works. But it seems port 443 is unreachable from the world wide web. Did you open TCP port 443 in some other firewall? Did you portmap TCP port 443 in your NAT router to your server, if applicable? (Guess not since it’s AWS.)

1 Like

Thanks! Turns out I needed to open port 443 on lightsail’s firewall too.

2 Likes

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