Skip to content

Instantly share code, notes, and snippets.

@aritode
Forked from bappi-d-great/create-new-site.txt
Created December 5, 2016 22:28
Show Gist options
  • Save aritode/08573cdda06e240b3eac656389a28ebb to your computer and use it in GitHub Desktop.
Save aritode/08573cdda06e240b3eac656389a28ebb to your computer and use it in GitHub Desktop.
Enable SSL in local site
# create a site with vhost domain sslsite.dev
# follow the on-screen instructions and configure your new site
$ vv create
$ cd /Volumes/Others/wpvm/vvv-incsub/config/nginx-config/sites
$ mkdir ssl
$ cd ssl
$ cd /Volumes/Others/wpvm/vvv-incsub/config/nginx-config/sites
$ sudo nano sslsite.conf
# Enter the following at the bottom but before ending curly brace
# {vvv_path_to_folder} should be the path referred to your VVV server
ssl on;
ssl_certificate {vvv_path_to_folder}/ssl/sslsite.dev.cert;
ssl_certificate_key {vvv_path_to_folder}/ssl/sslsite.dev.key;
$ openssl genrsa -out sslsite.dev.key 2048
$ openssl req -new -x509 -key sslsite.dev.key -out sslsite.dev.cert -days 3650 -subj /CN=sslsite.dev
$ vagrant provision
# Login with ssh into your VVV
$ vagrant ssh
# Find the path to your SSL cert and key, in my case it was custom-sites/ssl/sslsite.dev.cert and custom-sites/ssl/sslsite.dev.key
# So the configuration for me was
ssl on;
ssl_certificate custom-sites/ssl/sslsite.dev.cert;
ssl_certificate_key custom-sites/ssl/sslsite.dev.key;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment