My domain is: hahnca.com
My web server is (include version): nginx/1.18.0 (Ubuntu)
The operating system my web server runs on is (include version): Ubuntu 20.04.6
I can login to a root shell on my machine (yes or no, or I don't know): yes, I only use root (please don't judge)
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 2.8.0
I have followed certbot installation instructions from multiple tutorials on the web. Cert says my certicates are installed. Certbot modified my server.conf file. I checked and all files mentioned in the certbot modifed section are present and look good. When I go to my site http works but https gives "connection refused". Here are my nginx.conf and server.conf files ...
user root;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
index index.html;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
log_format scripts '$document_root$fastcgi_script_name > $request';
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/conf.d/*.conf;
# include /etc/nginx/sites-enabled/*;
}
server {
server_name hahnca.com;
root /root/apps/www/hahnca.com;
# listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/hahnca.com-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/hahnca.com-0001/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
}
Note that the file /root/apps/www/hahnca.com/index.html just outputs "error: hahnca.com is not a valid address.". This is because no one is supposed to go to that default page.
What am I doing wrong? Thanks in advance.