We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f56400 commit f2a5b20Copy full SHA for f2a5b20
src/hst_autocompile.sh
@@ -287,7 +287,17 @@ if [ "$NGINX_B" = true ] ; then
287
else
288
cp $BUILD_DIR/hestiacp-$branch/src/deb/nginx/nginx.conf "usr/local/hestia/nginx/conf/nginx.conf"
289
fi
290
-
+
291
+ # Update dns servers in nginx.conf
292
+ dns_resolver=$(cat /etc/resolv.conf | grep -i '^nameserver' | cut -d ' ' -f2 | tr '\r\n' ' ' | xargs)
293
+ for ip in $dns_resolver; do
294
+ if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
295
+ resolver="$ip $resolver"
296
+ fi
297
+ done
298
+ if [ ! -z "$resolver" ]; then
299
+ sed -i "s/1.0.0.1 1.1.1.1/$resolver/g" /usr/local/hestia/nginx/conf/nginx.conf
300
301
302
# copy binary
303
cp usr/local/hestia/nginx/sbin/nginx usr/local/hestia/nginx/sbin/hestia-nginx
0 commit comments