Admin-Ahead Community

Linux => General Linux => Topic started by: nandulalr on February 25, 2018, 12:51:30 am

Title: Address family not supported by protocol: nginx error
Post by: nandulalr on February 25, 2018, 12:51:30 am
Code: [Select]
# 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

The above error indicates that ipv6 is disabled on your server, hence service is and failed due to unsupported address family.

To resolve this issue, we need to edit the nginx configuration file, and comment out the below line(add # in front of it):

listen [::]:80;

Then restart the nginx service.

Code: [Select]
/etc/init.d/nginx restart

Code: [Select]
# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful