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

简介:

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

1
2
3
4
[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

检查配置文件:

1
2
3
4
5
6
7
8
9
10
11
12
     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西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1971551,如需转载请自行联系原作者
目录
相关文章
|
6月前
|
应用服务中间件 网络安全 nginx
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
Nginx配置SSL证书时——nginx:[emerg]unknowndirectivessl错误
1293 0
|
应用服务中间件 nginx
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
Mac Nginx nginx: [emerg] mkdir() “/usr/local/var/run/nginx/client_body_temp“ failed ...
304 2
|
3月前
|
存储 应用服务中间件 nginx
成功解决:nginx: [emerg] unexpected “}“ in /etc/nginx/conf.d/gulimall.conf:10
这篇文章详细介绍了Linux虚拟机磁盘空间不足时的扩容流程,从外部配置到具体扩容操作,再到验证扩容效果的步骤。同时,也探讨了Docker容器磁盘空间耗尽的问题,并提供了解决方案,包括删除无用镜像和容器,以及如何重新配置Docker的存储位置。文章还涵盖了一些意外情况的处理方法,比如误删容器后的恢复策略,并最终展示了使用Docker安装nginx并成功访问的详细过程。
成功解决:nginx: [emerg] unexpected “}“ in /etc/nginx/conf.d/gulimall.conf:10
|
应用服务中间件 nginx
Nginx nginx: [emerg] bind() to 0.0.0.0:8083 failed (48: Address already in use)
Nginx nginx: [emerg] bind() to 0.0.0.0:8083 failed (48: Address already in use)
402 1
|
6月前
|
应用服务中间件 nginx Windows
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
【报错】Windows下启动nginx报:bind() to 0.0.0.0:80 failed...
167 0
|
6月前
|
消息中间件 Kafka
org.apache.kafka.common.KafkaException: Socket server failed to bind to 114.115.20.100:9092: Cannot
org.apache.kafka.common.KafkaException: Socket server failed to bind to 114.115.20.100:9092: Cannot
70 0
|
6月前
|
应用服务中间件 网络安全 nginx
解决nginx:[emerg]unknown directive ssl错误
解决nginx:[emerg]unknown directive ssl错误
1647 0
|
6月前
|
存储 应用服务中间件 nginx
【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
【1月更文挑战第13天】【各种问题处理】nginx报错nginx: [error] open() “/run/nginx.pid” failed (2: No such file or directory)
|
6月前
|
应用服务中间件 nginx C++
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
|
6月前
|
应用服务中间件 nginx
Nginx启动时提示nginx: [emerg] still could not bind()
Nginx启动时提示nginx: [emerg] still could not bind()
602 0