Skip to content

Instantly share code, notes, and snippets.

View samrand96's full-sized avatar
🎯
Focusing

Samrand Hassan samrand96

🎯
Focusing
View GitHub Profile
@samrand96
samrand96 / cloudflare_plesk_log_integration.sh
Last active March 14, 2026 09:06
Script for Plesk Ubuntu that restores real visitor IPs behind Cloudflare by configuring Nginx and Apache (mod_remoteip), with automatic backups and a --uninstall option to revert changes.
#!/bin/bash
# Plesk Ubuntu Cloudflare Real IP Setup Script
# Sets CF-Connecting-IP for Nginx & Apache globally, with backups
# Usage:
# sudo ./setup_cf_realip.sh # install/update
# sudo ./setup_cf_realip.sh --uninstall # remove configs
set -e
NGINX_CONF="/etc/nginx/conf.d/cloudflare_realip.conf"