OSX 10.11我安装了最新的nginx 1.9.9(源码和编译)配置文件/usr/local/conf/nginx.conf语法正常
在收听端口8080时没问题我可以请求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)
但是当我将端口更改为80时,我无法达到http://example.local:80
================================================ server {听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打开页面,但我仍然可以请求http://example.local:8080
非常奇怪...... Nginx正在80岁时聆听......我该怎么办?
1 回答
你可以在下面的端口上运行服务作为sudo的1024 .
在旅途中跑步:
从系统开始:
请注意,您必须将服务器设置为在配置文件中侦听80,并确保端口80上没有其他进程正在运行 .