log_format configuration moved
This commit is contained in:
parent
a154e0c476
commit
683d847405
2 changed files with 23 additions and 24 deletions
23
conf.d/log.conf
Normal file
23
conf.d/log.conf
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# definiere mehrere Formate für logfiles
|
||||||
|
# Format main bindet gegenüber dem Default von nginx http_x_forwarded_for, gzip_ratio, request_time, upstream_response_time und pipe ein
|
||||||
|
log_format main '$remote_addr - $remote_user [$time_local] '
|
||||||
|
'"$request" $status $bytes_sent '
|
||||||
|
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for" '
|
||||||
|
'"$gzip_ratio" "$request_time" "$upstream_response_time" "$pipe"';
|
||||||
|
|
||||||
|
# das selbe Format nochmal nur mit ausgetauschter IP-Adresse
|
||||||
|
log_format ano '0.0.0.0 - $remote_user [$time_local] '
|
||||||
|
'"$request" $status $bytes_sent '
|
||||||
|
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for" '
|
||||||
|
'"$gzip_ratio" "$request_time" "$upstream_response_time" "$pipe"';
|
||||||
|
|
||||||
|
# dieses Format ist für revers-proxy gedacht um mehr informationen über den Cache Zustand bei der Anfrage zu erhalten
|
||||||
|
log_format cache '$time_local $upstream_cache_status '
|
||||||
|
'Cache-Control: $upstream_http_cache_control '
|
||||||
|
'Expires: $upstream_http_expires '
|
||||||
|
'"$request" ($status) "$gzip_ratio" '
|
||||||
|
'"$request_time" "$upstream_response_time" "$pipe"';
|
||||||
|
|
||||||
|
access_log /var/log/nginx/access.log main;
|
||||||
|
error_log /var/log/nginx/error.log warn;
|
||||||
|
|
24
nginx.conf
24
nginx.conf
|
@ -15,30 +15,6 @@ http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
|
|
||||||
# definiere mehrere Formate für logfiles
|
|
||||||
# Format main bindet gegen über dem Default http_x_forwarded_for, gzip_ratio, zeiten und pipe usw.
|
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] '
|
|
||||||
'"$request" $status $bytes_sent '
|
|
||||||
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for" '
|
|
||||||
'"$gzip_ratio" "$request_time" "$upstream_response_time" "$pipe"';
|
|
||||||
|
|
||||||
# das selbe Format nochmal nur mit ausgtauschter Fake IP
|
|
||||||
log_format ano '0.0.0.0 - $remote_user [$time_local] '
|
|
||||||
'"$request" $status $bytes_sent '
|
|
||||||
'"$http_referer" "$http_user_agent" "$http_x_forwarded_for" '
|
|
||||||
'"$gzip_ratio" "$request_time" "$upstream_response_time" "$pipe"';
|
|
||||||
|
|
||||||
# dieses Format ist für revers-proxy gedacht um mehr informationen über den Cache Zustand bei der Anfrage zu erhalten
|
|
||||||
log_format cache '$time_local $upstream_cache_status '
|
|
||||||
'Cache-Control: $upstream_http_cache_control '
|
|
||||||
'Expires: $upstream_http_expires '
|
|
||||||
'"$request" ($status) "$gzip_ratio" '
|
|
||||||
'"$request_time" "$upstream_response_time" "$pipe"';
|
|
||||||
|
|
||||||
|
|
||||||
access_log /var/log/nginx/access.log main;
|
|
||||||
|
|
||||||
upstream ro01 {
|
upstream ro01 {
|
||||||
server [2001:470:6c:655::2] weight=10;
|
server [2001:470:6c:655::2] weight=10;
|
||||||
server local.krautspace.de weight=1;
|
server local.krautspace.de weight=1;
|
||||||
|
|
Reference in a new issue