97: Address family not supported by protocol,nginx服務啟動失敗


1、啟動nginx服務報錯

環境:centos 6.9,yum安裝的nginx,啟動報錯

[root@lnmp ~]# 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

 

2、嘗試修改配置文件

vi /etc/nginx/nginx.conf

沒發現要修改的端口信息

listen 80;
仔細查看nginx的主配置文件發現include選項,包含了nginx的其他配置文件

然后繼續查看發現:

 

3、解決辦法

   vim /etc/nginx/conf.d/default.conf
將:
    listen       80 default_server;
    listen       [::]:80 default_server;
改為:
    listen       80;
    #listen     [::]:80 default_server;

啟動nginx就成功了。

 

 

 
         
         
       


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM