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;