Serving SSL with NGINX

 
NGINX allows you not only to act as a cashing server but you can also use it to run SSL connections and serve pages securely to the browser without the need for SSL support in your application server. And even if it does (like AOLserver) you don't have to compile it in.
To be able to work you need to have OpenSSL installed on your system and compile NGINX with the --with-http_ssl_module flag, which you have done if you were following my installation instructions.
For the SSL to work you need to define a new server which listens on port 443 that has SSL turned on: 

# My SSL
    server {
        listen       206.192.23.189:443;
        ssl on;
        # path to your certificate
        ssl_certificate /web/ssl/my.cer;
        # path to your ssl key
        ssl_certificate_key /web/ssl/my.key;
    }  

As you can see above you also specify your SSL certificates and you SSL key. These have to be created using OpenSSL. Note that we store them in /web/ssl, but you can store them also in /web/SERVICE0/ssl or any place you prefer.

cd /web/ssl
openssl genrsa -out my.key 1024
openssl req -new -key my.key -out request.pem
openssl req -x509 -days 30 -key my.key -in request.pem -out my.cer
Now you only need to add the location to your server statement above and you have SSL support powered by NGINX

        location / {
            proxy_pass http://192.168.92.92;
            proxy_read_timeout 240;
            proxy_set_header X-FORWARDED_PROTO https;
        }
Note to set the X-FORWARDED_PROTO header so OpenACS can figure out you are actually using SSL.