Skip to content

Instantly share code, notes, and snippets.

View arenadoon's full-sized avatar
✏️

Arena Artoon arenadoon

✏️
  • 18:41 (UTC +07:00)
View GitHub Profile
@arenadoon
arenadoon / nginx_cloudflare.conf
Created August 21, 2019 22:57 — forked from igortik/nginx_cloudflare.conf
Nginx & Cloudflare real IP configuration
# Look for client IP in the X-Forwarded-For header
real_ip_header X-Forwarded-For;
# Ignore trusted IPs
real_ip_recursive on;
# Trusted list
set_real_ip_from 199.27.128.0/21;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
@arenadoon
arenadoon / nginx.conf
Created August 21, 2019 22:56 — forked from igortik/nginx.conf
Nginx optimized configuration with DDoS mitigation
user nginx;
# one(1) worker or equal the number of _real_ cpu cores. 4=4 core cpu
worker_processes 4;
# renice workers to reduce priority compared to system processes for
# machine health. worst case nginx will get ~25% system resources at nice=15
worker_priority -5;