Skip to content

Instantly share code, notes, and snippets.

@mredar
Last active January 4, 2016 03:38
Show Gist options
  • Save mredar/8562735 to your computer and use it in GitHub Desktop.
Save mredar/8562735 to your computer and use it in GitHub Desktop.
self signed ssl cert installed to nginx
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