coreos-home-server/config/service/nginx/container/run-nginx
Alex Palaistras 85d4b221f4 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.
2021-11-27 17:45:16 +00:00

8 lines
244 B
Bash
Executable File

#!/bin/sh
# Set NGINX resolver from system-wide configuration.
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;'