Local patches to the code on your instance are almost always overwritten when you upgrade your instance. For most local patches, you'll need to reapply them after every upgrade.
When you set up your SSL certificates, use the instructions in this guide so that they won't be overridden when you upgrade.
The files in these locations will not be overridden the next time you upgrade your instance.
$ sudo service nginx restart
Next help article: Set up SSL certificates with Let's Encrypt →