Skip to content

Commit

Permalink
Fixed generation of resolvers.conf.
Browse files Browse the repository at this point in the history
This fixes scenarios where `resolv.conf` generated by dhcpcd has a nameserver with `%interface` appended to its IPv6 address.
For example, a line like this must be properly handled:
nameserver fe80::7747:4aff:fe9a:8cb1%br0
  • Loading branch information
jlesage committed Dec 27, 2021
1 parent 3a6bb3f commit 2816a73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rootfs/etc/cont-init.d/nginx-proxy-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ then
fi

# Generate the resolvers configuration file.
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /config/nginx/resolvers.conf
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" { sub(/%.*$/,"",$2); print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /config/nginx/resolvers.conf

# Hnandle IPv6 settings.
/opt/nginx-proxy-manager/bin/handle-ipv6-setting /etc/nginx/conf.d
Expand Down

0 comments on commit 2816a73

Please sign in to comment.