SSL Certificate redirection of 80 port

I have certificate of ssl. that is .crt file and .key file. now after i installed erpnext , website name is site1.local, how can i add ssl certificate in it. ??

redirection of 80 port to 443. can any one please suggest me. ?? tried many things but wont work for me.

@dineshpanchal432: you may want to go through another forum thread (https://discuss.frappe.io/t/where-do-i-install-the-ssl-for-a-production-site/3834) to get some clues.

@gvyshnya i have tired all possible way still in trouble.

I need steps and which file i have to edit and what are the redirection will do.

I did this this weekend.

You firstly need to rename your path by mv the folder name. Then you need to add a line to the .json file in the folder above (described in the forum post #gvyshnya mentioned) with the hostname. This is important and not in the Frappe docs currently.

There is a command that downloads certbot to setup Lets Encrypt, and sets up the hostname with a new ssl cert and after restarting nginx your site is now loaded with SSL.

If you have your own certs you will have to work around this differently, or just use the Lets Encrypt free ones perhaps as its easier to get up and running this way.

Julian