All Projects → koenoe → freenas-proxy

koenoe / freenas-proxy

Licence: MIT License
My FreeNAS proxy using Nginx reverse proxy to redirect traffic to internal IPs on different ports.

Programming Languages

Nginx
273 projects
HTML
75241 projects

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].