The Error 54113 from a Varnish Cache Server is typically a backend connection error, which means Varnish couldn’t reach your origin server (backend) or received an invalid response.
It’s often associated with HTTP 503 Service Unavailable errors but is more specific to Varnish setups.
🧠 What Is Error 54113 in Varnish?
Varnish Error 54113 means:
Varnish tried to fetch content from the backend (your web server like Apache, NGINX, etc.) but failed, so it couldn’t serve anything to the client.
You might see this message:
🔧 How to Fix Error 54113 – Step-by-Step
✅ 1. Check Backend Server Status
Make sure your origin server is actually running and accepting connections.
If you use Apache:
sudo systemctl status apache2If you use NGINX:
sudo systemctl status nginx
📌 If it’s down, restart it:
✅ 2. Check Backend Port & Configuration
Varnish needs to connect to the right port where your backend is serving content.
Open your Varnish config file (usually
/etc/varnish/default.vcl)Look for the
backenddefinition:
Ensure the backend service (like Apache or NGINX) is actually running on that port.
Example: Apache might default to port 80, but Varnish is trying 8080.
🔍 Test with:
If it fails, there’s your problem.
✅ 3. Check for Backend Timeouts
Sometimes the backend is slow or returns incomplete headers, triggering a fetch failure.
Increase timeout values in
default.vcl:
Then reload Varnish:
✅ 4. Check Varnish Logs
Use varnishlog or journalctl to see exactly why it failed:
Look for lines like:
This will give exact details — like timeout, reset, bad response, etc.
✅ 5. Check for Bad Headers or Responses
Varnish is picky — if your backend sends malformed headers, it may reject the response.
Use curl -I or a browser tool to inspect headers:
Check for:
Missing
Content-LengthInvalid status codes
Encoding issues
✅ 6. Restart Services in Order
Sometimes Varnish is started before the backend is ready.
Restart both in order:
🧰 Quick Summary: Fixing Error 54113
| Step | Fix |
|---|---|
| 1 | Check if backend server is up |
| 2 | Make sure Varnish is pointing to the right port |
| 3 | Test backend with curl |
| 4 | Review Varnish logs for fetch errors |
| 5 | Increase timeout values |
| 6 | Restart Varnish after backend is ready |
Be the first to comment