remove ipv6 conf from nginx proxy if ipv6 not enabled

This commit is contained in:
Jonny McCullagh 2022-10-12 14:54:25 +01:00
parent 6cab57932e
commit 9b830c5b19
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ NGINX_CONF_FILE="/etc/nginx/nginx.conf"
DEFAULT_CONF_FILE="/etc/nginx/conf.d/default.conf" DEFAULT_CONF_FILE="/etc/nginx/conf.d/default.conf"
# check if we have ipv6 available # check if we have ipv6 available
if [ ! -f "/proc/net/if_jonnyinet6" ]; then if [ ! -f "/proc/net/if_inet6" ]; then
# ipv6 not available so delete lines from nginx conf # ipv6 not available so delete lines from nginx conf
if [ -f "$NGINX_CONF_FILE" ]; then if [ -f "$NGINX_CONF_FILE" ]; then
sed -i '/listen \[::\]/d' $NGINX_CONF_FILE sed -i '/listen \[::\]/d' $NGINX_CONF_FILE