Skip to content
← All articles

ERR_CONNECTION_REFUSED: Causes and Fix

Short answer. ERR_CONNECTION_REFUSED is an active TCP refusal: your browser reached the server, but nothing is listening on the target port (80 or 443), or a firewall dropped the packet. The usual culprits are a down web server, the wrong port, or a hosting-side block. The first step is to check whether the port is open with curl -I -v https://example.com and whether the host responds to ping.

What ERR_CONNECTION_REFUSED means

Unlike a timeout, a "refused" error returns instantly — but it returns a rejection. At the TCP level, the server answers your SYN packet with an RST. This happens when the web-server process (nginx, Apache, Node.js) is not running, listens on a different port, or a firewall is set to DROP/REJECT.

"Connection refused" tells you the network path to the server works. The problem isn't routing — it's that nothing on the far end accepts the connection.

Main causes

  • Web server not running — nginx/Apache crashed, container stopped.
  • Wrong port — the service listens on 8080 while you hit 80/443.
  • Firewall blocks the port — iptables, ufw, or a cloud security group.
  • Local proxy or VPN intercepts and rejects the request.
  • Stale browser or DNS cache points to an old or wrong IP.

User-side diagnostics

First separate a browser issue from a network issue. Check the host and port:

ping example.com
curl -I -v https://example.com
# Test a specific port (Linux/macOS)
nc -zv example.com 443

Flush the DNS cache and clear the browser cache:

# Windows
ipconfig /flushdns

# macOS
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

User-side fix

  1. Open the site in incognito mode or another browser.
  2. Disable VPN, proxy, and extensions that block traffic.
  3. Clear the browser cache and flush the DNS cache (commands above).
  4. Reboot the router and check your hosts file for stray entries.
  5. Try mobile data — this rules out your own network.

Server-side fix

If every visitor sees the error, the server is at fault. Verify the service is running and listening:

# Is nginx running and what ports does it listen on?
sudo systemctl status nginx
sudo ss -tlnp | grep -E ':80|:443'

# Is the port open in the firewall?
sudo ufw status

Causes and solutions

CauseSolution
Web server crashedRestart it: systemctl restart nginx
Wrong portSet config to 80/443, check the listen directive
Firewall blockingOpen the port: ufw allow 443/tcp
Client proxy/VPNDisable it or add an exception
Stale cached IPFlush the browser and OS DNS cache

How to prevent it from recurring

A one-off refusal you can fix by hand, but repeated server crashes are caught only by monitoring. Set up an uptime check that hits your port every few minutes and alerts via Telegram, Slack, email, or webhook before users complain. A multi-region check (RU/EU/US) shows whether the issue is local or global.

Check site availability and HTTP headers now, and the ping and port checker reveals whether the target port is open. For continuous monitoring, see the website monitoring guide.

FAQ

How is ERR_CONNECTION_REFUSED different from a timeout?

Refused means the server actively rejects the connection (RST); a timeout means it stays silent and packets are lost. Refused is usually faster to fix: the service is either down or the port is closed.

Is it my problem or the site's?

Test the site on mobile data and another device. If it fails everywhere, the server is to blame. If only you see it, check VPN, proxy, firewall, and DNS cache.

Will rebooting the router help?

Sometimes — if the router cached an old IP or NAT hung. But if the port is genuinely closed server-side, a client reboot won't help.

How do I learn the server crashed again quickly?

Add uptime monitoring with 1–5 minute checks and alerts. The enterno.io free plan gives 10 monitors and a 5-minute interval.

Check your website right now

Check if your site is reachable →
More articles: Сети
Сети
ERR_CONNECTION_RESET Fix
23.06.2026 · 26 views
Сети
Best Online Port Scanners 2026
15.06.2026 · 44 views
Сети
"This Site Can't Be Reached" Fix
23.06.2026 · 20 views
Сети
ERR_CONNECTION_TIMED_OUT Fix
23.06.2026 · 27 views