December 2018
Beginner
826 pages
22h 54m
English
Assuming your site is currently up and running on port 80, inside your VM, you should be able to make the following changes to your files to enable HTTPS communication:
$ sudo sed -i 's/listen 80/listen 443 ssl/g' /etc/nginx/conf.d/fenchurch.conf$ sudo sed -i '4iinclude snippets/snakeoil.conf;' /etc/nginx/conf.d/fenchurch.conf
Ensure that your file looks similar to the following by using cat:
$ cat /etc/nginx/conf.d/fenchurch.conf server {listen 443 ssl;listen [::]:80;include snippets/snakeoil.conf;root /var/www/fenchurch;index index.html;server_name 127.0.0.1;location / {try_files $uri $uri/ =404;}}
Now ensure that the snake oil certificates are available by installing the ssl-cert package:
$ sudo apt install ssl-cert -y ...