View ngixn version and compile parameters
/usr/local/nginx/sbin/nginx -V
Back up what you have:
cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
Configure a new module with ssl
./configure --prefix=/usr/local/nginx --with-http_ssl_module(nginx.conf configuration file, will use the conf folder)
compile
make and
replace the previous one (the service needs to be stopped before replacement):
cp objs/ nginx /usr/local/nginx/sbin/nginx
Restart:
./nginx