What Are ERR_CONNECTION_CLOSED and ERR_EMPTY_RESPONSE and How Do You Fix Them?

Sunucun 3 min read

ERR_CONNECTION_CLOSED is an error showing that the browser connected to a site but the server (or a device in between) closed the connection before sending the page data. Chrome then shows “… unexpectedly closed the connection” on the “This site can’t be reached” page. A similar error, ERR_EMPTY_RESPONSE, appears with the message “… didn’t send any data”. In this guide we explain the causes of both errors and how to fix them.

Illustration: What Are ERR_CONNECTION…

What Does ERR_CONNECTION_CLOSED Mean?

The browser has established a connection with the server and sent its request, but the connection was closed by the other side before a response arrived. This is different from ERR_CONNECTION_RESET, where the connection is cut abruptly by an RST packet: here the connection ends with a normal close, but the browser has not received the data it was waiting for. ERR_EMPTY_RESPONSE belongs to the same family and shows that the server closed the connection without sending any response.

For the case where the connection is reset, see our guide on ERR_CONNECTION_RESET; for the case where it is refused at the start, see ERR_CONNECTION_REFUSED.

Causes of the Error

  • Unstable connection or router problem: Connection drops can close the connection before the data the server sends reaches you.
  • VPN, proxy or security software: Software that inspects traffic can close connections it finds suspicious.
  • Network-level filtering: Workplace, school or internet provider filters can close connections to certain sites.
  • A crashing process on the server: If the PHP or application process crashes before producing a response, the web server may close the connection with an empty response. This is the most common cause of ERR_EMPTY_RESPONSE.
  • Server limits and security rules: A timeout, a memory limit or a security rule can end the connection without processing the request.
  • HTTPS/SSL configuration: Connecting with HTTPS to a port that expects HTTP (or the other way round) can make the connection close without any data.

How to Fix It as a Visitor

  1. Try opening the site from another network: If it opens on your phone over mobile data, the problem is on your network; if not, it is most likely on the site.
  2. Restart your router.
  3. Turn off VPN and proxy: On Windows, check Settings > Network & Internet > Proxy.
  4. Test your security software: Briefly turn off the antivirus web protection or HTTPS scanning and try again.
  5. Reset network settings: Open Command Prompt as administrator, run these commands and restart the computer:
netsh winsock reset
netsh int ip reset
ipconfig /flushdns
  1. Clear the browser cache and turn off extensions: Try the site in an incognito window; if it opens, turn extensions off one by one.

How to Fix It as a Site Owner

  1. Check the error logs: “segmentation fault”, “upstream prematurely closed connection” or memory limit warnings in the web server and PHP-FPM error logs point to crashing processes.
  2. Check memory and time limits: Review memory_limit, max_execution_time and the web server’s timeout settings. Identify heavy plugins or queries.
  3. Review security rules: ModSecurity, WAF or CDN rules can block certain requests by closing the connection.
  4. Verify the port and protocol match: Make sure HTTPS is served on port 443 and HTTP on port 80, and that the SSL certificate is installed correctly.
  5. Monitor resource usage: Servers that reach their process or connection limits may close new requests without a response.

If you want full access to server settings and error logs, a VDS server with root access lets you carry out all of these checks yourself.

Conclusion

ERR_CONNECTION_CLOSED and ERR_EMPTY_RESPONSE show that the connection was closed without a response being sent. As a visitor, changing the network, checking the VPN, proxy and security software, and resetting network settings is usually enough. If everyone sees the error, review the server’s error logs, limits and security rules.

Categories

Latest guides