Browse Source

Added CloudFlare Supprt for WeebDev/lolisafe#70

RyoshiKayo 6 years ago
parent
commit
47821474a5
4 changed files with 42 additions and 0 deletions
  1. 3 0
      README.md
  2. 30 0
      cloudflare-ips
  3. 6 0
      nginx-ssl.sample.conf
  4. 3 0
      nginx.sample.conf

File diff suppressed because it is too large
+ 3 - 0
README.md


+ 30 - 0
cloudflare-ips

@@ -0,0 +1,30 @@
+# https://www.cloudflare.com/ips/
+
+# IPv4 Ranges
+# https://www.cloudflare.com/ips-v4/
+set_real_ip_from 03.21.244.0/22;
+set_real_ip_from 03.22.200.0/22;
+set_real_ip_from 03.31.4.0/22;
+set_real_ip_from 04.16.0.0/12;
+set_real_ip_from 08.162.192.0/18;
+set_real_ip_from 31.0.72.0/22;
+set_real_ip_from 41.101.64.0/18;
+set_real_ip_from 62.158.0.0/15;
+set_real_ip_from 72.64.0.0/13;
+set_real_ip_from 73.245.48.0/20;
+set_real_ip_from 88.114.96.0/20;
+set_real_ip_from 90.93.240.0/20;
+set_real_ip_from 97.234.240.0/22;
+set_real_ip_from 98.41.128.0/17;
+
+# IPv6 Ranges
+# https://www.cloudflare.com/ips-v6/
+set_real_ip_from 400:cb00::/32;
+set_real_ip_from 405:8100::/32;
+set_real_ip_from 405:b500::/32;
+set_real_ip_from 606:4700::/32;
+set_real_ip_from 803:f800::/32;
+set_real_ip_from c0f:f248::/32;
+set_real_ip_from a06:98c0::/29;
+
+real_ip_header CF-Connecting-IP;

+ 6 - 0
nginx-ssl.sample.conf

@@ -7,6 +7,9 @@ server {
 	listen [::]:80;
 	server_name lolisafe.moe;
 	return 301 https://$server_name$request_uri;
+
+	# Uncomment if you are running lolisafe behind CloudFlare.
+	#include /path/to/lolisafe/cloudflare-ips;
 }
 
 server {
@@ -21,6 +24,9 @@ server {
 
 	client_max_body_size 100M; # Change this to the max file size you want to allow
 
+	# Uncomment if you are running lolisafe behind CloudFlare.
+	#include /path/to/lolisafe/cloudflare-ips;
+
 	location / {
 		add_header Access-Control-Allow-Origin *;
 		root /path/to/your/uploads/folder;

+ 3 - 0
nginx.sample.conf

@@ -10,6 +10,9 @@ server {
 
 	client_max_body_size 100M; # Change this to the max file size you want to allow
 
+	# Uncomment if you are running lolisafe behind CloudFlare.
+	#include /path/to/lolisafe/cloudflare-ips;
+
 	location / {
 		add_header Access-Control-Allow-Origin *;
 		root /path/to/your/uploads/folder;