Updating CloudFlare IP addresses

This commit is contained in:
myvesta 2021-04-17 19:09:01 +02:00 committed by GitHub
commit c7a089b37e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,7 +28,7 @@ if [ ! -f "/usr/local/vesta/data/upgrades/update-cloudflare-ips" ]; then
if [ -f "/etc/nginx/nginx.conf" ]; then
touch /usr/local/vesta/data/upgrades/update-cloudflare-ips
echo "== Updating CloudFlare IP addresses"
sed -i 's/ set_real_ip_from 104.16.0.0/12;/ set_real_ip_from 104.16.0.0/13;\n set_real_ip_from 104.24.0.0/14;/g' /etc/nginx/nginx.conf
sed -i "s| set_real_ip_from 104.16.0.0\/12;| set_real_ip_from 104.16.0.0/13;\n set_real_ip_from 104.24.0.0/14;|g" /etc/nginx/nginx.conf
systemctl restart nginx
fi
fi