Nginx fails to start, related to ipv6

My YunoHost server

Hardware: Raspberry Pi 3 at home
YunoHost version: 10.0.10
I have access to my server : Through SSH

Description of my issue

Hi,

After a reboot, Nginx is not starting anymore.

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

I looks like I have no ipv6 but I can’t figure out how to fix this. Should I activate ipv6 and how? Or should I disable ipv6 for nginx? Any help welcome.

Right now I have written a script to disable ipv6 listening for ngnix. I would like to turn it into a hook. I have seen some samples from @metyun at Share your "hooks" to apply custom configurations- Partagez vos "hooks" pour appliquer des configurations personnelles - #2 by metyun but I don’t know how to write a hook properly.

#!/bin/bash

# comment out lines containing ipv6 listening in nginx config files

sed -i "/listen \[::\]:/ s/^#*/#/" /etc/nginx/conf.d/domain.tld.conf
sed -i "/listen \[::\]:/ s/^#*/#/" /etc/nginx/conf.d/yunohost_admin.conf
sed -i "/listen \[::\]:/ s/^#*/#/" /etc/nginx/sites-available/default

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.