Skip to content

Instantly share code, notes, and snippets.

View maxmichels's full-sized avatar

Max Michels maxmichels

View GitHub Profile
@maxmichels
maxmichels / update_cloudflare_ips_for_nginx.sh
Last active April 14, 2021 18:08
Cron Plesk / Nginx Allow Cloudflare set_real_ip_from
#!/bin/bash
# Update the IP List for nginx config
# Allowed ips will be stored in /etc/nginx/conf.d/00_real_ip_cloudflare_00.conf
# File is imported by /etc/nginx/nginx.conf
echo "#Cloudflare" > /etc/nginx/conf.d/00_real_ip_cloudflare_00.conf;
for i in $(curl https://www.cloudflare.com/ips-v4 2>/dev/null); do
echo "set_real_ip_from $i;" >> /etc/nginx/conf.d/00_real_ip_cloudflare_00.conf;
done
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
@maxmichels
maxmichels / allow-with-referrer.txt
Last active March 29, 2020 10:01
Block xmlrpc.php
RewriteEngine On
RewriteCond %{HTTP_HOST}@@%{HTTP_REFERER} !^([^@]*)@@https?://\1/.*
RewriteRule .*\xmlrpc.php [NC,F]
### Keybase proof
I hereby claim:
* I am maxmichels on github.
* I am maxmichels (https://keybase.io/maxmichels) on keybase.
* I have a public key whose fingerprint is 7A9C E1A6 F1B1 C51A 533C CEE8 D4CC D866 8211 47C5
To claim this, I am signing this object: