Apart from that, docker and docker-compose will be used to setup my environment which is really really convenient tools for deployment. I guess you should already know what this items are so I am not going to explain how to use these tools here.
Create and configure Nginx configure in cond.d directory.
You can apply proxy_pass in location if you need.
Configure 1
normal.conf
Configure 2
ssl.conf
Let's Encrypt
Sign Cert
Navigate to the root directory and run the following command to sign the certificate from Let’s Encrypt.
Note! You have to use full path in Volume Mirror
Renew
If you want to automatically renew the cert, you can use crontab to do the schedule job. You can use contab -e to do the job but this will only apply in the user-level. I would recommend you to do this in system-level — edit the config directly in /etc/crontab.
You can use following script to schedule the task. it will run every 15 days.
Note! Cert can only be renewed within last 30 days.
The renew command will take a look at all active certificates and renew those who are close to expiring — which is currently defined as 30 days before the expiration date. If your certificates aren’t due for renewal yet, the client won’t renew them.
The reason why a daily cronjob is recommended is in order to avoid issues caused by service downtime on Let’s Encrypt’s end, or any issues your server might have. If you, for example, run the cronjob just once every month or every two months, and the service just happens to be down during those times, you’ll end up with an expired certificate eventually. By doing it daily instead, Let’s Encrypt would have to be down for 30 consecutive days for that to happen, which is rather unlikely.
- [SOLVED] How often to renew?