SWAG-Real-IP: Better detection

This commit is contained in:
Roxedus
2021-01-21 18:47:11 +01:00
parent 5dca15f695
commit b4342d40e0
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
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"
ip route | grep -v default | awk '{print $1}'
}) > /config/nginx/cf_real-ip.conf
chown abc:abc /config/nginx/cf_real-ip.conf