This repository has been archived on 2024-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
nginx-config/conf.d/log.conf

24 lines
1.1 KiB
Text
Raw Normal View History

2016-05-21 14:10:36 +02:00
# 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;