标签: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