-
-
Save aritode/08573cdda06e240b3eac656389a28ebb to your computer and use it in GitHub Desktop.
Enable SSL in local site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a site with vhost domain sslsite.dev | |
# follow the on-screen instructions and configure your new site | |
$ vv create |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd /Volumes/Others/wpvm/vvv-incsub/config/nginx-config/sites | |
$ mkdir ssl | |
$ cd ssl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vagrant provision |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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