From 460137779f9c14c46e3390f891e1119a4ee20f36 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Mon, 19 Sep 2016 16:06:19 -0400 Subject: [PATCH] Switch proxy resolver to use the local resolv.conf values --- conf/init/service/nginx/run | 3 +++ conf/nginx/server-base.conf | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/conf/init/service/nginx/run b/conf/init/service/nginx/run index 0095f76d7..16bf0a13e 100755 --- a/conf/init/service/nginx/run +++ b/conf/init/service/nginx/run @@ -2,6 +2,9 @@ echo 'Starting nginx' +NAMESERVER=`cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' '` +echo "resolver $NAMESERVER valid=10s;" > /conf/nginx/resolver.conf + if [ -f /conf/stack/ssl.key ] then echo "Using HTTPS" diff --git a/conf/nginx/server-base.conf b/conf/nginx/server-base.conf index 983874e40..a2f4600c4 100644 --- a/conf/nginx/server-base.conf +++ b/conf/nginx/server-base.conf @@ -31,9 +31,9 @@ location /realtime { } location ~ ^/_storage_proxy/([^/]+)/([^/]+)/([^/]+)/(.+) { - auth_request /_storage_proxy_auth; + include resolver.conf; - resolver 8.8.8.8; + auth_request /_storage_proxy_auth; proxy_pass $2://$3/$4$is_args$args;