I’ve recently began working on a side project that requires me to serve files over https. Given some trial and error, I managed to get a server up and running perfectly. I thought I’d share which solution worked best for me. I’ve always been a minimalist, so if ‘keeping it simple’ is your M.O., you may find this quick tutorial quite useful.
If you’re running on the latest ubuntu, then the only dependency you’ll need to install is Nginx.
Create a Self-Signed SSL Certificate
Create a directory to store the ssl files.
Next, generate a self-signed ssl certificate. Self-signed, meaning the digital certificate is signed using its own private key.
After you’ve completed the form, the following files should have been generated:
To configure Nginx, open the
default file located in the sites-available directory.
Make the following changes to enable both http and https requests.
Next, test the that the changes you’ve made were successful.
Then, restart Nginx.
Now you should be good to go!
Running within Vargent (optional)
If you’re a mac user, such as myself, I would recommend using Vagrant. It easily allows users to run their vm on a private network.
Here’s an initial Vagrant file to get you started.