From 85d4b221f463f68f1dc99e3a27b50d2c20c11222 Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Sat, 27 Nov 2021 17:45:16 +0000 Subject: [PATCH] nginx: Don't resolve with IPv6, only cache for 60s This commit updates the default resolver configuration for Nginx servers to not attempt to resolve IPv6 addresses, and only holds resolved IPs for a maximum of 60 seconds, in order to avoid issues with stale cache. --- config/service/nginx/container/run-nginx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/service/nginx/container/run-nginx b/config/service/nginx/container/run-nginx index a6001d1..72c35c8 100755 --- a/config/service/nginx/container/run-nginx +++ b/config/service/nginx/container/run-nginx @@ -1,7 +1,7 @@ #!/bin/sh # Set NGINX resolver from system-wide configuration. -awk '/^nameserver/ {printf "resolver %s;\n", $2; exit}' /etc/resolv.conf > /etc/nginx/resolver.conf +awk '/^nameserver/ {printf "resolver %s valid=60s ipv6=off;\n", $2; exit}' /etc/resolv.conf > /etc/nginx/resolver.conf # Start NGINX as foreground process. nginx -g 'daemon off;'