← Back to all fixes

Connection refused on port 443 (HTTPS)

The Issue

`curl https://yourdomain.com` gives: `curl: (7) Failed to connect to yourdomain.com port 443`

Root Cause

Nginx is not listening on port 443. Either the SSL server block is missing, nginx is not reloaded after adding it, or firewall blocks 443.

How to Fix
  1. Check what ports nginx listens on: `sudo ss -tlnp | grep nginx`
  2. Verify your nginx config has a `listen 443 ssl;` block
  3. Reload nginx after config changes: `sudo systemctl reload nginx`
  4. Open port in firewall: `sudo ufw allow 443` or the equivalent for your cloud security group
  5. Check certbot ran successfully and cert files exist at the referenced paths