Procházet zdrojové kódy

Truncate IP addresses

master
Chris Smith před 5 roky
rodič
revize
8b7edfb54f
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. 7
    1
      nginx.conf

+ 7
- 1
nginx.conf Zobrazit soubor

@@ -14,9 +14,15 @@ http {
14 14
     include       /etc/nginx/mime.types;
15 15
     default_type  application/octet-stream;
16 16
 
17
+    map $http_x_forwarded_for $forwarded_anon {
18
+        ~(?P<ip>\d+\.\d+\.\d+)\.    $ip.0;
19
+        ~(?P<ip>[^:]+:[^:]+):       $ip::;
20
+        default                     0.0.0.0;
21
+    }
22
+
17 23
     log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
18 24
                       '$status $body_bytes_sent "$http_referer" '
19
-                      '"$http_user_agent" "$http_x_forwarded_for"';
25
+                      '"$http_user_agent" "$forwarded_anon"';
20 26
 
21 27
     access_log  /logs/access.log  main;
22 28
 

Načítá se…
Zrušit
Uložit