Skip to content

Commit 01a1a41

Browse files
minimal log format
1 parent 35e0127 commit 01a1a41

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

tools/reverse-proxy/nginx.conf

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,11 @@ http {
1212
include /etc/nginx/mime.types;
1313
default_type application/octet-stream;
1414

15-
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
16-
'$status $body_bytes_sent "$http_referer" '
17-
'"$http_user_agent" "$http_x_forwarded_for"';
18-
19-
# Debug log format - shows Host header details for troubleshooting routing issues
20-
log_format debug_routing '$remote_addr [$time_local] "$request" '
21-
'status=$status '
22-
'host="$host" '
23-
'http_host="$http_host" '
24-
'server_name="$server_name" '
25-
'scheme=$scheme '
26-
'x_forwarded_host="$http_x_forwarded_host" '
27-
'x_forwarded_proto="$http_x_forwarded_proto"';
28-
29-
access_log /var/log/nginx/access.log debug_routing;
15+
# Minimal log format to avoid logging sensitive headers (e.g., Authorization tokens)
16+
# Only logs request URI, status code, and remote address
17+
log_format path_status '$request_uri $status $remote_addr';
18+
19+
access_log /var/log/nginx/access.log path_status;
3020

3121
sendfile on;
3222
#tcp_nopush on;

0 commit comments

Comments
 (0)