mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-07-18 08:48:27 -04:00
c49baad276
It would produce a malformed line, stopping nginx from running if it failed to curl the list
12 lines
387 B
Plaintext
12 lines
387 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" &
|
|
curl -s "https://www.cloudflare.com/ips-v6" &
|
|
echo "$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p' | sed 's/\.[0-9]*$//')/16"
|
|
}) > /config/nginx/cf_real-ip.conf
|
|
|
|
chown abc:abc /config/nginx/cf_real-ip.conf
|