Add SSL
Video Lecture
Description
Let's make http://socketio-example.your-domain.tld have an SSL certificate and redirect all HTTP traffic to HTTPS
We can get free certificates from CertBot
Before we start, we should add the server_name
setting to our Nginx conf that we created for our socketio-example
website.
cd /etc/nginx/sites-enabled/
nano socketio-example.conf
Add the highlighted line, and change YOUR-DOMAIN-NAME
to be your domain name.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Now we can install Certbot and enable the command.
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
And now run it.
sudo certbot --nginx
Note
If your domain name hasn't fully propagated across the internet yet, then CertBot will not be able to validate your request with your IP and you will need to try again an hour or so later.
Now visit https://socketio-example.your-domain.tld
or visit mine to see a working example