curl: (52) Empty reply from server
The server closed the connection without replying
Seen in curl, libcurl (CURLE_GOT_NOTHING)
The TCP connection opened, but the server closed it without sending any HTTP response.
Common causes
- Sending plain HTTP to a port that expects TLS, such as http://host:443.
- The application crashed or hit a fatal error before writing a response.
- A proxy, WAF or rate limiter dropped the request silently.
- A service in a container listening only on 127.0.0.1, behind a port mapping that accepts the connection but has nothing to forward to.
How to fix it
- Check the scheme matches the port: https:// for TLS ports.
- Look at the application and proxy logs for crashes at the time of the request.
- Run curl -v to confirm the request was sent and nothing came back.
- Make services inside containers listen on 0.0.0.0, not 127.0.0.1.
Got a different message? Paste it into the error explainer.
Related errors
- wrong version number · TLS spoken to something that isn't TLS
- curl: (7) Failed to connect · The connection was refused or unreachable
- Error: socket hang up · The server closed the connection before replying
- UND_ERR_CONNECT_TIMEOUT · fetch couldn't open a connection in time
- unable to get local issuer certificate · The client can't find the certificate's issuer
- unable to verify the first certificate · The intermediate certificate is missing
- certificate has expired · The server certificate has expired
- self signed certificate in certificate chain · The chain ends in an untrusted root
- curl: (6) Could not resolve host · The hostname doesn't resolve
- curl: (28) Operation timed out · The request timed out
- curl: (51) SSL: no alternative certificate subject name matches target host name · The certificate doesn't match the hostname
- curl: (3) URL using bad/illegal format or missing URL · curl could not parse the URL