Sunday, December 9, 2007

Adding SSL Site To Nginx Quick Start

If now is one of those times you just want to Get 'Er Done and not have a long drawn out process for doing something, welcome.

Step 1: Install OpenSSL
user@machine ~> sudo apt-get install openssl

Step 2: Create Self Signed Certificate [Answer questions in a way that makes you feel good ;)]
user@machine ~> sudo openssl req -new -x509 -days 365 -nodes -out /root/nginx.cert -keyout /root/nginx.key

Step 3: Add SSL options to nginx.conf [/etc/nginx/nginx.conf maybe?]

server {
listen 443;
server_name smallbiztechguy.blogspot.com;
error_page 403 404 500 502 503 504 /nginx-errors/error.htm;

ssl on;
ssl_certificate /root/nginx.cert;
ssl_certificate_key /root/nginx.key;

location / {
charset utf-8;
root /var/www;
index index.htm;
}

}


Step 4: Restart nginx

user@machine ~> ps aux | grep -i nginx
user@machine ~> kill -HUP [id from ps command above]

No comments: