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

nginx安装中若碰到如下错误异常:

这个是因为nginx默认启用了ipv6,只需修改配置即可(/etc/nginx/sites-enabled/default)

找到如下代码:

listen 80 default_server;
listen [::]:80 default_server;

修改为:

listen 80 ;
#listen [::]:80 default_server;

Leave a Reply

Your email address will not be published. Required fields are marked *