nginx [emerg] socket() []80 failed (97 Address family not supported by protocol)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx [emerg] socket() []80 failed (97 Address family not supported by protocol)相关的知识,希望对你有一定的参考价值。

1、nginx报错信息

早上通过LNMP部署owncloud 10.0.2的云盘环境,修改nginx配置文件后,重启报错:
nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)


2、分析并解决报错

看到 socket() [::]:80 failed,第一反应就是好像与IPV6有关,Address family not supported by protocol也进一步印证了我的想法,如是想到查看nginx配置文件

修改nginx的配置文件:

vim /etc/nginx/nginx.conf

如果不知道nginx的配置文件在哪,可以通过find命令或者rpm -ql nginx(rpm形式安装的话)进行查找nginx.conf

# rpm -ql nginx|grep nginx.conf
/etc/nginx/nginx.conf
/etc/nginx/nginx.conf.default

重新启动nginx,告警消失



本文出自 “冰冻vs西瓜” 博客,请务必保留此出处http://molewan.blog.51cto.com/287340/1942907

以上是关于nginx [emerg] socket() []80 failed (97 Address family not supported by protocol)的主要内容,如果未能解决你的问题,请参考以下文章

阿里云ECS在CentOS 6.9中使用Nginx提示:nginx: [emerg] socket() [::]:80 failed (97: Address family not supported

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)

nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)解决

如何更正'nginx:[emerg]“流”指令在这里不允许'

[emerg]: getpwnam(“nginx”) failed

nginx - nginx:[emerg] bind()到[::]:80失败(98:地址已经在使用中)