Files
docker-mods-uptime-kuma-tim…/root/etc/cont-init.d/98-cloudflare-real-ip
T
Roxedus d3b1e25a1b Attempt to prevent race conditions
Which somehow mattered
2021-08-23 21:05:34 +02:00

10 lines
464 B
Plaintext

#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# shellcheck disable=SC2046
printf "set_real_ip_from %b;\n" $(curl -s "https://www.cloudflare.com/ips-v4") > /config/nginx/cf_real-ip.conf
printf "set_real_ip_from %b;\n" $(curl -s "https://www.cloudflare.com/ips-v6") >> /config/nginx/cf_real-ip.conf
printf "set_real_ip_from %b;\n" $(ip route | grep -v default | awk '{print $1}') >> /config/nginx/cf_real-ip.conf
chown abc:abc /config/nginx/cf_real-ip.conf