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,如需转载请自行联系原作者
目录
相关文章
|
8月前
|
应用服务中间件 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 ...
156 2
|
2月前
|
消息中间件 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
10 0
|
3月前
|
应用服务中间件 网络安全 nginx
解决nginx:[emerg]unknown directive ssl错误
解决nginx:[emerg]unknown directive ssl错误
183 0
|
8月前
|
应用服务中间件 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)
204 1
|
4月前
|
应用服务中间件 nginx C++
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
nginx: [emerg] unknown directive “rtmp“ in ./../conf/nginx.conf:16
|
7月前
|
应用服务中间件 网络安全 nginx
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
121 0
|
8月前
|
应用服务中间件 nginx
Nginx nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp"
Nginx nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp"
147 0
|
9月前
|
应用服务中间件 nginx
nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142
nginx: [emerg] duplicate location “/“ in /usr/local/etc/nginx/nginx.conf:142
175 0
|
11月前
|
Java 关系型数据库 MySQL
14. 成功解决:ERROR:ssl_client_socket_impl.cc(992) handshake failed; returned -1, SSL error code 1, net_error -103
今天使用 Python 的 selenium 时,一直在报如下错误:[30616:22540:0328/093748.004:ERROR:ssl_client_socket_impl.cc(992)] handshake failed; returned -1, SSL error code 1, net_error -100
2800 0
|
应用服务中间件 Linux nginx
Linux下启动Nginx时报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
Linux下启动Nginx时报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
572 0
Linux下启动Nginx时报错:nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)