mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-02-27 04:45:22 +00:00
Attempt to fix #5335 by allowing resovler generation to be opt-out with a env var
All checks were successful
Close stale issues and PRs / stale (push) Successful in 38s
All checks were successful
Close stale issues and PRs / stale (push) Successful in 38s
This commit is contained in:
@@ -7,8 +7,10 @@ log_info 'Dynamic resolvers ...'
|
||||
|
||||
# Dynamically generate resolvers file, if resolver is IPv6, enclose in `[]`
|
||||
# thanks @tfmm
|
||||
if [ "$(is_true "$DISABLE_IPV6")" = '1' ]; then
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) ipv6=off valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
else
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
if [ "$(is_true "${DISABLE_RESOLVER:-}")" = '0' ]; then
|
||||
if [ "$(is_true "${DISABLE_IPV6:-}")" = '1' ]; then
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) ipv6=off valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
else
|
||||
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf) valid=10s;" > /etc/nginx/conf.d/include/resolvers.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -12,7 +12,7 @@ process_folder () {
|
||||
FILES=$(find "$1" -type f -name "*.conf")
|
||||
SED_REGEX=
|
||||
|
||||
if [ "$(is_true "$DISABLE_IPV6")" = '1' ]; then
|
||||
if [ "$(is_true "${DISABLE_IPV6:-}")" = '1' ]; then
|
||||
# IPV6 is disabled
|
||||
echo "Disabling IPV6 in hosts in: $1"
|
||||
SED_REGEX='s/^([^#]*)listen \[::\]/\1#listen [::]/g'
|
||||
|
||||
Reference in New Issue
Block a user