I also found this tip really useful to get a letsencrypt certificate working for both www.example.com as well as the example.com address.