Created
October 6, 2011 15:43
-
-
Save alexandergiraldo/1267737 to your computer and use it in GitHub Desktop.
Generate Certificates HTTPS
This file contains 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
$ sudo nginx -s stop | |
$ sudo nginx |
This file contains 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 /usr/local/nginx/ssl |
This file contains 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 -des3 -out localhost.key 1024 |
This file contains 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 req -new -key localhost.key -out localhost.csr |
This file contains 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
$ cp localhost.key localhost.key.org | |
$ openssl rsa -in localhost.key.org -out localhost.key |
This file contains 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 x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt |
This file contains 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
$ sudo vim /usr/local/conf/nginx.conf |
This file contains 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
# HTTPS server | |
# | |
server { | |
listen 443; | |
server_name localhost; | |
ssl on; | |
ssl_certificate /usr/local/nginx/ssl/localhost.crt; | |
ssl_certificate_key /usr/local/nginx/ssl/localhost.key; | |
keepalive_timeout 70; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment