Disable nginx IPv6 listener when disabled on host (#1998)

* Disable nginx IPv6 listener when disabled on host

Patch nginx.conf when host has IPv6 disabled so nginx does not fail to start.

* clarified comment
This commit is contained in:
descensus
2025-12-26 16:50:11 -07:00
committed by GitHub
parent 4d8092e5bc
commit fb162cb2ad
+3
View File
@@ -11,6 +11,9 @@ envsubst '${BOOKLORE_PORT}' < /etc/nginx/nginx.conf > "$TMP_CONF"
# Move to final location # Move to final location
mv "$TMP_CONF" /etc/nginx/nginx.conf mv "$TMP_CONF" /etc/nginx/nginx.conf
# Disable nginx IPv6 listener when IPv6 is disabled on host
[ "$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6 2>/dev/null)" = "0" ] || sed -i '/^[[:space:]]*listen \[\:\:\]:6060;$/d' /etc/nginx/nginx.conf
# Start nginx in background # Start nginx in background
nginx -g 'daemon off;' & nginx -g 'daemon off;' &