最近想使用云服务器来部署自己的web应用。

利用yum install nginx安装了nginx后,

用命令service nginx start 启动时,出现错误如下

启动nginx报错,80 failed (97: Address family not supported by protocol)_nginx

找到nginx的配置文件:

vim /etc/nginx/conf.d/default.conf
#
# The default server
#

server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location / {
}

error_page 404 /404.html;
location = /40x.html {
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
}

}

启动nginx报错,80 failed (97: Address family not supported by protocol)_nginx安装_02

listen       [::]:80 default_server;

该部分注释掉即可

启动nginx报错,80 failed (97: Address family not supported by protocol)_html_03