nginx 443 failed解决方案: Address family not supported by protocol

在CentOS 6.5下,安装Nginx (网页服务器),启动报错:

nginx: [emerg] socket() [::]:443 failed (97: Address family not supported by protocol)
nginx: configuration file /etc/nginx/nginx.conf test failed

经检查发现,/etc/nginx/default.d/default.conf默认配置文件中包含以下代码:

include /etc/nginx/default.d/*.conf;

之后在/etc/nginx/default.d/ssl.conf文件中发现以下语句:

listen 443 ssl http2 default_server;
listen [::]:443 ssl;

更改为:

  listen 443 ssl http2 default_server;
# listen [::]:443 ssl;

然后执行以下命令(#):

service nginx restart

获得以下结果:

Stopping nginx: [ OK ]
Starting nginx: [ OK ]

问题成功解决。

《nginx 443 failed解决方案: Address family not supported by protocol》有303个想法

发表评论