Skip to content

Commit

Permalink
properly log originating request IP addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekEagle committed Dec 11, 2024
1 parent ef19724 commit 07d80f3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
25 changes: 25 additions & 0 deletions nginx/cf-connecting-ip.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/13;
set_real_ip_from 104.24.0.0/14;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
set_real_ip_from 2c0f:f248::/32;

real_ip_header CF-Connecting-IP;
4 changes: 3 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Nginx Cumulonimbus Configuration
# DO NOT copy this file to sites-enabled in /etc/nginx symlink it so you don't have to copy it after every update.
log_format default '$http_x_forwarded_for - [$time_local] '
include /var/www-data/nginx/cf-connecting-ip.conf;

log_format default '$http_cf_connecting_ip $http_x_forwarded_for - [$time_local] '
'$host "$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent"';
client_max_body_size 100M;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"vite-plugin-pwa": "^0.21.1",
"vue-tsc": "^2.1.10"
},
"packageManager": "yarn@3.5.0+sha512.2dc70be5fce9f66756d25b00a888f3ca66f86b502b76750e72ba54cec89da767b938c54124595e26f868825688e0fe3552c26c76a330673343057acadd5cfcf2"
"packageManager": "yarn@3.8.7+sha512.bbe7e310ff7fd20dc63b111110f96fe18192234bb0d4f10441fa6b85d2b644c8923db8fbe6d7886257ace948440ab1f83325ad02af457a1806cdc97f03d2508e"
}

0 comments on commit 07d80f3

Please sign in to comment.