Nginx: broken, how to write a hook?

,

Hi,

My server was working fine until today. Then after a reboot I have this error.

nginx: 
  configuration: broken
  configuration-details: 
    - 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

It looks like I have no more ipv6. As far as I know I have changed nothing on the server for weeks. It’s a regular configuration on a Raspberry Pi 3B+

I already had this problem in the past. I searched the forum and the web. The only thing I could find was to disable manually each config file related to ipv6. Which is a dirty solution. Later I had to change my disk so I started on a brand new disk. And after a few months the same problem suddenly occurs.

I’m ready to listen any suggestion since I’m unable to solve this alone.

It looks like I will get no answer about the main problem. I do not need ipv6. Il would like to disable it in a “clean” way. Could someone explain me how to do a hook?

I guess it looks like this but I have never done it
/etc/yunohost/hooks.d/conf_regen/17-nginx_disable_ipv6

#!/bin/bash

##############################################
# Disable ipv6 listening for nginx/conf
# Comment out lines with "listen [::]:"
#############################################

sed -i "/listen \[::\]:/ s/^#*/#/" /etc/nginx/conf.d/piwi.nohost.me.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.