I can not establish a connection to port 443 on my nginx server.
I needed port 443 to enable https connections, I used certbot to install an ssl certificate, and I went with the default installation, and default instructions in this guide
Even though I've set the 'nginx full' command to open both http and https ports, I double checked to make sure that port 443 is really open by running the following command sudo lsof -i -P -n | grep LISTEN
, and in the response, I got port 443 as being used by nginx
I tried tools like cURL to test my ports, port 80 works just fine, but I get no response from port 443
I lack experience with server administration and I tried to check other resources but I don't know what else to do.
my sites-available configuration:
server {
root /var/www/muhammed-aldulaimi.com/html;
index index.html index.htm index.nginx-debian.html;
server_name muhammed-aldulaimi.com www.muhammed-aldulaimi.com;
location / {
try_files $uri $uri/ =404;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/muhammed-aldulaimi.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/muhammed-aldulaimi.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.muhammed-aldulaimi.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = muhammed-aldulaimi.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
listen [::]:80;
server_name muhammed-aldulaimi.com www.muhammed-aldulaimi.com;
return 404; # managed by Certbot
}
ufw status:
22/tcp ALLOW Anywhere
Nginx Full ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
Nginx Full (v6) ALLOW Anywhere (v6)