Last active
January 4, 2016 03:38
-
-
Save mredar/8562735 to your computer and use it in GitHub Desktop.
self signed ssl cert installed to 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
openssl genrsa -des3 -out server.key 2048 | |
openssl req -new -key server.key -out server.csr | |
openssl rsa -in server.key -out server.key.nopass | |
openssl x509 -req -days 1024 -in server.csr -signkey server.key.nopass -out server.crt | |
This will produce an base64 encoded ascii file (server.crt) that can be used as a .pem file. Use the server.key.nopass as the server key, so you don't have to enter the password on webserver restarts. | |
vim /etc/nginx/nginx.conf -- point to it | |
/etc/init.d/nginx stop | |
/etc/init.d/nginx start | |
/etc/init.d/nginx reload | |
Finally, make the service start automatically at every reboot. | |
/sbin/chkconfig nginx on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment