freenas-proxy
My FreeNAS proxy using Nginx reverse proxy to redirect traffic (80/443) to internal IPs on different ports.
Installation guide
Configure Nginx
Create a standard jail via the UI of FreeNAS. Call it 'webserver' and login at FreeNAS via SSH in your Terminal:
Identify jail 'webserver' and login. Install Git and Nginx:
jls
jexec <ID> csh
pkg upgrade
pkg install nano git nginx
Open the file '/etc/rc.conf' and add following line:
nginx_enable="YES"
Start Nginx:
service nginx start
Install SSL certificate in jail
Download the certificate at TransIP. Unzip, open a new Terminal window and point to the folder. Merge the .crt files into one:
cat certificate.crt cabundle.crt > ssl-bundle.crt
Secure the bundled certificate and key to the 'webserver' jail via FreeNAS:
scp ssl-bundle.crt certificate.key [email protected]:/mnt/tank/jails/webserver/usr/local/etc/nginx
Login again in FreeNAS via ssh and generate dhparam.pem file for extra security:
cd /usr/local/etc/nginx && openssl dhparam -out dhparam.pem 4096
Clone this repository
cd /root && git clone https://github.com/koenoe/freenas-proxy.git
Create a symlink for Nginx configuration
cd /usr/local/etc/nginx && mv nginx.conf nginx.conf.backup && ln -s /root/freenas-proxy/nginx.conf nginx.conf
Start Nginx
Make sure the log folder exist and restart Nginx:
cd /usr/local/etc/nginx && mkdir logs
service nginx restart