In order to install Nginx, we will use Brew, as we did with PHP. The command is the following:
$ brew install nginx
If you want to make Nginx start every time you start your laptop, run the following command:
$ ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
If you have to change the configuration of
Nginx, you will find the file in /usr/local/etc/nginx/nginx.conf
. You can change
things, such as the port that Nginx is listening to or the root
directory where your code is (the default directory is /usr/local/Cellar/nginx/1.8.1/html/
). Remember to
restart Nginx to apply the changes with the sudo nginx
command.