From 2816a73b8fa85d13ef1715df56531ac6f83d8c95 Mon Sep 17 00:00:00 2001 From: Jocelyn Le Sage Date: Sun, 26 Dec 2021 21:43:15 -0500 Subject: [PATCH] Fixed generation of resolvers.conf. 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 --- rootfs/etc/cont-init.d/nginx-proxy-manager.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rootfs/etc/cont-init.d/nginx-proxy-manager.sh b/rootfs/etc/cont-init.d/nginx-proxy-manager.sh index 918b8df..b0e34c0 100755 --- a/rootfs/etc/cont-init.d/nginx-proxy-manager.sh +++ b/rootfs/etc/cont-init.d/nginx-proxy-manager.sh @@ -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