Teoh Han Hui пре 8 година
родитељ
комит
065dd7f1ea
2 измењених фајлова са 2 додато и 1 уклоњено
  1. 1 0
      docker-entrypoint.sh
  2. 1 1
      nginx.tmpl

+ 1 - 0
docker-entrypoint.sh

@@ -22,6 +22,7 @@ fi
 export RESOLVERS=$(awk '$1 == "nameserver" {print $2}' ORS=' ' /etc/resolv.conf | sed 's/ *$//g')
 if [ "x$RESOLVERS" = "x" ]; then
     echo "Warning: unable to determine DNS resolvers for nginx" >&2
+    unset RESOLVERS
 fi
 
 # If the user has run the default command and the socket doesn't exist, fail

+ 1 - 1
nginx.tmpl

@@ -58,7 +58,7 @@ log_format vhost '$host $remote_addr - $remote_user [$time_local] '
 
 access_log off;
 
-{{ if ne $.Env.RESOLVERS "" }}
+{{ if $.Env.RESOLVERS }}
 resolver {{ $.Env.RESOLVERS }};
 {{ end }}