nginx重启后重新连接提示连接失败

一看到网站连接失败是绝望的。一开始还以为是nginx停止的原因,那nginx重启了一遍又一遍发现无济于事

/usr/local/webserver/nginx/sbin/nginx -s reload            # 重新载入配置文件
/usr/local/webserver/nginx/sbin/nginx -s reopen            # 重启 Nginx
/usr/local/webserver/nginx/sbin/nginx -s stop              # 停止 Nginx

然后又排查了权限和nginx.conf 发现都没问题!那就奇怪了。。

最后抱着摸着石头过河的心态用/root/nginx-1.9.9/sbin/nginx  -c  /root/nginx-1.9.9/conf/nginx.conf  命令来启动下Nginx。

发现了几个错误(总比没错误摸索好)

nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
nginx: [emerg] still could not bind()

貌似是端口的问题。将/conf/nginx.conf 里面的监听端口改为80  。OK正常访问

 

已root权限启动的用 1024以下的端口,没有用1024以上

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值