Skip to content

Instantly share code, notes, and snippets.

@kennwhite
Forked from alexandergiraldo/restart_nginx
Created April 18, 2013 02:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kennwhite/5409462 to your computer and use it in GitHub Desktop.
Save kennwhite/5409462 to your computer and use it in GitHub Desktop.
$ sudo nginx -s stop
$ sudo nginx
$ cd /usr/local/nginx/ssl
$ openssl genrsa -des3 -out localhost.key 1024
$ openssl req -new -key localhost.key -out localhost.csr
$ cp localhost.key localhost.key.org
$ openssl rsa -in localhost.key.org -out localhost.key
$ openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt
$ sudo vim /usr/local/conf/nginx.conf
# 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