#!/bin/sh # if $NGINX_RESOLVERS set to local, set it to the local resolvers from /etc/resolv.conf and export it # DO NOT EDIT THIS FILE set -eu LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NGINX_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {if ($2 ~ ":") {print "["$2"]"} else {print $2}}' /etc/resolv.conf) # remove trailing space NGINX_RESOLVERS="${NGINX_RESOLVERS% }" export NGINX_RESOLVERS