If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to
nginx.org.
Commercial support is available at
nginx.com.
Thank you for using nginx.
After you have edit the .html file under the folder which is specified after the root in default.conf of nginx, you can use certbot to apply certification for your website.
Here I will show how to do this on CentOS 7. To check what OS your mechine run, use the following syntax
cat /etc/os-release
Actually, you can directly follow the instruction on the website of certbot.
sudo yum install epel-release
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install --classic certbot
. You may get an error: "error: too early for operation, device not yet seeded or device model not acknowledged", but this is OK. Just run the same code again.sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot certonly --nginx
. Here you can add --preferred-chain "ISRG Root X1"
to specify the chain you want to use. Then you are done.If you have successfully update your certification, you will receive the following message after the operation:
Successfully received certificate.
Certificate is saved at: /etc/letsencrypt/live/xxxx.com/fullchain.pem
Key is saved at: /etc/letsencrypt/live/xxxx.com/privkey.pem
This certificate expires on xxxx-xx-xx.
These files will be updated when the certificate renews.
Certbot has set up a scheduled task to automatically renew this certificate in the background.