尝试在端口80上运行时,在OSX上的nginx沮丧

由于某种原因,这不起作用:

server { listen 80; server_name localhost; location / { root html; index index.html index.htm; } ... } 

我有

 Failed to connect ... port 80: Connection refused 

(我testing了nginx正在运行,端口80被它占用)

然后,我改变了听指令:

 listen [::]:80; 

它的工作…

但是我有其他服务器的问题,例如:

 server { #listen 80; listen [::]:80; server_name project.dev; location / { try_files $uri $uri.html $uri/index.html; root /Users/david/project; index index.html index.htm; } } 

我把project.dev放在/ etc / hosts中:

 127.0.0.1 project.dev 

但在这里我得到

 curl: (7) Failed to connect to project.dev port 80: Connection refused 

无论…

我不喜欢它,我必须首先指定ip6([::]),但现在我更喜欢它,因为它甚至不能与除主函数之外的其他服务器指令一起工作…

如何摆脱这个混乱?