switch to hybrid

This commit is contained in:
aptalca
2022-08-18 14:35:26 -04:00
parent 60445609b3
commit 9ba68dda22
6 changed files with 11 additions and 0 deletions
@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
# shellcheck disable=SC2046
printf "set_real_ip_from %b;\n" $(curl -s "https://api.cloudflare.com/client/v4/ips" | jq -r '.result.ipv4_cidrs[]') > /config/nginx/cf_real-ip.conf
printf "set_real_ip_from %b;\n" $(curl -s "https://api.cloudflare.com/client/v4/ips" | jq -r '.result.ipv6_cidrs[]') >> /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
@@ -0,0 +1 @@
oneshot
@@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-swag-cloudflare-real-ip-setup/run