How to install Nginx in FreeBSD

There are two ways of installing Nginx in FreeBSD. You can install Nginx using package system or ports system. The second way is more flexible.

Installing Nginx from package

pkg_add -r nginx

Installing Nginx from ports

cd /usr/ports/www/nginx
make install clean

Mark modules you need for your build and press OK.

Activating Nginx

When compilation and installation are finished you can try to start Nginx:

/usr/local/etc/rc.d/nginx onestart

If you want Nginx to start with the system add to /etc/rc.conf:


Nginx configuration file is located in /usr/local/etc/nginx/nginx.conf. Nginx default document root directory is in /usr/local/www/nginx.

Got a comment?
Name (optional):
Anti-Bot:captcha =
Copyright © 2024 HowToUnix - *nix Howtos and Tutorials
All Rights Reserved.