diff --git a/Dockerfile b/Dockerfile index c2ae1bc..158c04e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -123,6 +123,10 @@ RUN \ mv /etc/nginx/conf.d/include/ip_ranges.conf /defaults/ && \ ln -sf /config/nginx/ip_ranges.conf /etc/nginx/conf.d/include/ip_ranges.conf && \ + # Make sure the config file for resovers is stored in persistent volume. + rm /etc/nginx/conf.d/include/resolvers.conf && \ + ln -sf /config/nginx/resolvers.conf /etc/nginx/conf.d/include/resolvers.conf && \ + # Make sure nginx cache is stored on the persistent volume. ln -s /config/nginx/cache /var/lib/nginx/cache && \ diff --git a/rootfs/etc/cont-init.d/nginx-proxy-manager.sh b/rootfs/etc/cont-init.d/nginx-proxy-manager.sh index a96876c..b6ea2dd 100755 --- a/rootfs/etc/cont-init.d/nginx-proxy-manager.sh +++ b/rootfs/etc/cont-init.d/nginx-proxy-manager.sh @@ -143,6 +143,9 @@ then > /dev/null 2>&1 fi +# Generate the resolvers configuration file. +echo resolver $(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) ";" > /config/nginx/resolvers.conf + # Take ownership of the config directory content. find /config -mindepth 1 -exec chown $USER_ID:$GROUP_ID {} \;