To install Nginx on your Mac you can use simply brew command:
$ brew install nginxDefault Nginx server name is localhost with 8080 port. So you can see default Nginx page by entering http://localhost:8080 address. Let's change something:
Changing default server name and port
Nginx.conf located at /usr/local/etc/nginx/nginx.conf dir. Open it with your favorite editor, to me the Vim:
$ vim /usr/local/etc/nginx/nginx.confYou'll see default server configuration like this:
server { listen 8080; server_name locahost;Change them with what you want and save the file. To reload Nginx configuration you should restart Nginx by calling these:
## other things}
$ sudo nginx -s stop$ sudo nginxIncluding multi server defination from different files
Aww, cool topic. To keep different server definations in different files, you should need to this. Open nginx.conf, locate your cursor to the end of http defination block and simple paste this two lines:
$ include /usr/local/etc/nginx/conf.d/*.conf;Now your can create symlinks to these directories. Of course, don't forget to restart Nginx!
$ include /usr/local/etc/nginx/sites-enabled/*.conf;