Install nginx on FreeBSD

Posted on Sat 23 April 2011 in FreeBSD

nginx logo

Nginx is a real fast and easy to configure webserver. It can work in proxy mode like squid and handles much traffic nicely.

If you want to install this great webserver on FreeBSD just use the ports collection and run the following commands:

cd /usr/ports/www/nginx

make install  clean

There are configuration examples for the most usecases in the wikipage of nginx: wiki.nginx.org

The default document root is /usr/local/www/nginx.

After you are done with your configuration start the deamon with /usr/local/etc/rc.d/nginx onestart or add the service to your /etc/rc.conf to be started on every boot. Without further configuration or content upload you should see a simple "Welcome to nginx!" page on your browser.