• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue Docker + Varnish - Reboot Mystery

pr0tax

New Pleskian
Hello,

I followed the Plesk/Varnish tutorial on here with Docker and it works a charm. I continued to apply some other updates to the server afterwards, then I did a reboot and everything went horribly wrong. Luckily I had a snapshot available, but I didn't need it in the end.

The conclusion is (TLDR), when I reboot the server, it just throws up a whole load of 503 backend errors.

The fix was for me to run the last couple of steps everytime I reboot the server:

docker ps | grep varnish | awk {'print $1'} | xargs -i docker exec -t {} sed -i '/.port/c\ .port = "7080";' /etc/varnish/default.vcl

and

docker ps | grep varnish | awk {'print $1'} | xargs -i docker exec -t {} sed -i '/.host/c\ .host = "203.0.113.2";' /etc/varnish/default.vcl

With my server IP in the second command. After this, I reboot the container and all works again perfectly.

It seems as though something is missing when rebooting the server, as I have to repeat this process everytime... am I best just installing and configuring Varnish on the actual server or is there something I'm missing?

N.B - I have tried it with both "Automatic start after system reboot" on and off...
 
Back
Top