码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2017-10-12 10:36:33      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:nginx

今天测试Docker下配置一个nginx模板的镜像,装好nginx后,使用nginx -t进行检查,报错如下:

[root@a381c4c04132 yum.repos.d]# 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

检查配置文件:

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
根据错误提示分析,监听的方式可能不支持ipv6,于是将其注释掉
    server {
        listen       80 default_server;
#        listen       [::]:80 default_server;
然后再次检查配置:
[root@a381c4c04132 yum.repos.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
没有报错了,问题解决

 


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

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

标签:nginx

原文地址:http://molewan.blog.51cto.com/287340/1971551

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!