NginX

Similar to the Apache installation, we update the package database, and install the nginx and ca-certificates packages. The latter package will install the Certification Authorities certs, which may be useful when dealing with SSL.

Then we enable listening to the 443 port (SSL), and include the snippet for the default SSL site served via HTTPS.

In the following two lines (here broken over three lines each for easy reading) we use PERL to substitute the filenames and path of SSL/TLS certificate and private key.

In last line we restart NginX.

apt-get update 
apt-get install nginx ca-certificates 
perl -i -pe 's/# listen/listen/g' /etc/nginx/sites-enabled/default 
perl -i -pe \ 
's/# include snippets\/snakeoil.conf/include snippets\/snakeoil.conf/g' \ 
/etc/nginx/sites-enabled/default 
perl -i -pe \ 
's|/etc/ssl/certs/ssl-cert-snakeoil.pem|/usr/local/freeswitch/certs/cert.pem|g' \ 
/etc/nginx/snippets/snakeoil.conf 
perl -i -pe \ 
's|/etc/ssl/private/ssl-cert-snakeoil.key|/usr/local/freeswitch/certs/privkey.pem|g' \ 
/etc/nginx/snippets/snakeoil.conf 
service nginx restart