EDIT - June 17,2021 This post is quite old now and only still works on older version 10 and 11 ERPNext systems that still run the python 2.7 packages. All other commands remain the same but the let’s encrypt has changes with v13. So, for the newer version of the Let’s Encrypt command, please use the instructions from this post:
Continuing the discussion from Can't find site name on Easy Install:
The correct process is NOT to rename site1.local but to use the following process:
- bench config dns_multitenant on
- bench setup add-domain --site site1.local [new-domain-name]
- sudo --H bench lets-encrypt site1.local --custom-domain [new-domain-name]
- sudo service nginx reload
The above process first turns on dns multitenant. This is required even if you will only have one site hosted.
The “add-domain” command assigns your new domain name to site1.local site without trying to modify the actual site name in the rest of the system. site1.local appears in many locations and you may not be able to edit that in some locations. That is why the add-domain command is used. It takes care of associating the new domain name with site1.local throughout the system.
The format of the command for setting up a lets-encrypt certificate also calls out both the site1.local name and the new assigned domain name thereby also establishing the association everywhere that the ssl cert is needed.
Hope this helps.