NGINX and Varnish Connection failed (localhost:6082)

  • Posted March 20, 2014

My wordpress site gives error 521 all the times.

When I found this error from my server

$sudo service varnish reload
 * Reloading HTTP accelerator varnishd                                                                                                     Connection failed (localhost:6082)
Error: vcl.load 8d6fb6be-9a0a-4896-be47-e2678e3c2617 /etc/varnish/default.vcl failed

Moreover, varnishlog shows nothing.

I am following this tutorial to set the server up. And, I changed

DAEMON_OPTS="-a :80 \
    -T localhost:6082 \
    -f /etc/varnish/default.vcl \
    -u www-data -g www-data \
    -S /etc/varnish/secret \
    -s malloc,256m"

The /etc/varnish/default.vcl file is copied from the tutorial. All &a mp; has been corrected to &.

It is a fresh droplet. No firewall.

Any clue to resolve it?



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Can you try connecting to it manually to see if we can get some more useful error output: <br> <br> varnishadm -T localhost:6082 <br> <br>Also, check out our Varnish, Nginx, Wordpress tutorial: <br> <br>