File tree 1 file changed +45
-0
lines changed
1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,51 @@ server {
122
122
}
123
123
```
124
124
125
+ modsecurity_transaction_id
126
+ --------------------------
127
+ ** syntax:** * modsecurity_transaction_id string*
128
+
129
+ ** context:** * http, server, location*
130
+
131
+ ** default:** * no*
132
+
133
+ Allows to pass transaction ID from nginx instead of generating it in the library.
134
+ This can be useful for tracing purposes, e.g. consider this configuration:
135
+
136
+ ``` nginx
137
+ log_format extended '$remote_addr - $remote_user [$time_local] '
138
+ '"$request" $status $body_bytes_sent '
139
+ '"$http_referer" "$http_user_agent" $request_id';
140
+
141
+ server {
142
+ server_name host1;
143
+ modsecurity on;
144
+ modsecurity_transaction_id "host1-$request_id";
145
+ access_log logs/host1-access.log extended;
146
+ error_log logs/host1-error.log;
147
+ location / {
148
+ ...
149
+ }
150
+ }
151
+
152
+ server {
153
+ server_name host2;
154
+ modsecurity on;
155
+ modsecurity_transaction_id "host2-$request_id";
156
+ access_log logs/host2-access.log extended;
157
+ error_log logs/host2-error.log;
158
+ location / {
159
+ ...
160
+ }
161
+ }
162
+ ```
163
+
164
+ Using a combination of log_format and modsecurity_transaction_id you will
165
+ be able to find correlations between access log and error log entries
166
+ using the same unique identificator.
167
+
168
+ String can contain variables.
169
+
125
170
126
171
# Contributing
127
172
You can’t perform that action at this time.
0 commit comments