Can’t get Nginx to work on port 80. Works fine on any other port

The error is as follows:

2015/10/10 17:16:19 [emerg] 23906#0: bind() to failed (48: Address already in use)

That “Address already in use” says it all: Something else on your system is using port 80. Do you have web sharing enabled or perhaps Apache installed and running? The way you can check this is to run lsof like this on your system:

sudo lsof -i -P | grep -i "80"

That will strictly show you what process might be using port 80. If you are curious to see what other ports are set to “listen” on your Mac OS X system just run this command:

sudo lsof -i -P

Rebooted OSX. Worked. I think with linux would be different.