Configure Varnish on Ubuntu 18.04 for backend webserver

The installation of varnish is pretty forward on Ubuntu 18.04 as before, but the configuration of varnish is a little tricky on this sytemd enabled Ubuntu 18.04.

The main purpose for this task is to setup varnish to serve on 80 and backend nginx running on 8080. All most all the steps following posts from goes very well except for varnish is still running on default port 6081 instead of 80.

Then here’s the magic line:

Configure port 80 in /lib/systemd/system/varnish.service

Thanks to !!! You saved on morning for me!

Now I could access following sites runing behind this varnish server:

Happy Ending!