Nginx : Cannot listen on port 80 ... only port 8080 works on OSX 10.11 -
osx 10.11 installed latest nginx 1.9.9 (from source , compiled ) configuration file /usr/local/conf/nginx.conf syntax ok
when listening on port 8080 no problem can request http://example.local:8080
server { listen 8080; server_name example.local; root html; sudo lsof -i -p | grep -i "80" nginx 8254 root 10u ipv4 0x643a3abbad7bf485 0t0 tcp *:8080 (listen) nginx 8392 yves 10u ipv4 0x643a3abbad7bf485 0t0 tcp *:8080 (listen)
but when change port 80, cannot reach http://example.local:80
================================================ server { listen 80; server_name example.local; root html;
sudo nginx -s reload nginx 8254 root 10u ipv4 0x643a3abbad7bf485 0t0 tcp *:8080 (listen) nginx 8254 root 18u ipv4 0x643a3abbadbb9485 0t0 tcp *:80 (listen) nginx 8430 yves 10u ipv4 0x643a3abbad7bf485 0t0 tcp *:8080 (listen) nginx 8430 yves 18u ipv4 0x643a3abbadbb9485 0t0 tcp *:80 (listen)
safari canot open page can still request http://example.local:8080
very weird .... nginx listening on 80 ... can ?
you can run services on ports below 1024 sudo.
running on go:
$ sudo brew services restart nginx
starting system:
$ sudo cp /usr/local/opt/nginx/*.plist /library/launchdaemons $ sudo launchctl load -w /library/launchdaemons/homebrew.mxcl.nginx.plist
note must set server listen 80 inside config file , make sure there's no other process running @ port 80.
Comments
Post a Comment