97: Address family not supported by protocol,nginx服务启动失败


1、启动nginx服务报错

环境:centos 6.9,yum安装的nginx,启动报错

[root@lnmp ~]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
nginx: configuration file /etc/nginx/nginx.conf test failed

 

2、尝试修改配置文件

vi /etc/nginx/nginx.conf

没发现要修改的端口信息

listen 80;
仔细查看nginx的主配置文件发现include选项,包含了nginx的其他配置文件

然后继续查看发现:

 

3、解决办法

   vim /etc/nginx/conf.d/default.conf
将:
    listen       80 default_server;
    listen       [::]:80 default_server;
改为:
    listen       80;
    #listen     [::]:80 default_server;

启动nginx就成功了。

 

 




					


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM