zEitEr
Super Moderator
Hello,
We've got an issue with bandwidth usage shown in Awstats.
Images (static files) requested through nginx/apache are fully logged with its size only in nginx logs:
nginx shows size 2084443 bytes :
apache shows size only 310 bytes (tech headers for nginx):
it's due to how nginx is proxying requests for static files:
Thus we have the following stats:
Date 1:
From apache logs Total = 665.337 MB / 588798 hits
From nginx logs Total = 17786.5 MB / 588689 hits
Images from (/Image/) requested 242632 times according to apache logs: Total = 74.4036 MB
Images from (/Image/) requested 242889 times according to NGINX logs: Total = 16735.7 MB
Date 2:
From apache logs Total = 360.118 MB / 263632 hits
From nginx logs Total = 12664.1 MB / 264290 hits
Images from (/Image/) requested 175191 times according to apache logs: Total = 53.7159 MB
Images from (/Image/) requested 175807 times according to NGINX logs: Total = 11986.4 MB
Awstats gets data from apache logs only, and it does not read nginx logs. And it is nginx which serves static files. Thus Awstat might need to get data from nginx logs.
The same might be actual for webalizer.
Please fix it.
We've got an issue with bandwidth usage shown in Awstats.
Images (static files) requested through nginx/apache are fully logged with its size only in nginx logs:
nginx shows size 2084443 bytes :
Code:
207.46.13.36 - - [06/Nov/2015:09:52:25 +0100] "GET /Image/1602/16.JPG HTTP/1.1" 200 2084443 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
apache shows size only 310 bytes (tech headers for nginx):
Code:
207.46.13.36 - - [06/Nov/2015:09:52:19 +0100] "GET /Image/1602/16.JPG HTTP/1.0" 200 310 "-" "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)"
it's due to how nginx is proxying requests for static files:
Code:
location /
{
# access_log off;
proxy_buffering off;
proxy_pass http://11.22.33.44:8080;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /nginx_static_files/
{
# access_log /var/log/nginx/access_log_proxy;
alias /home/userbob/domains/domain.com/public_html/;
internal;
}
Thus we have the following stats:
Date 1:
From apache logs Total = 665.337 MB / 588798 hits
From nginx logs Total = 17786.5 MB / 588689 hits
Images from (/Image/) requested 242632 times according to apache logs: Total = 74.4036 MB
Images from (/Image/) requested 242889 times according to NGINX logs: Total = 16735.7 MB
Date 2:
From apache logs Total = 360.118 MB / 263632 hits
From nginx logs Total = 12664.1 MB / 264290 hits
Images from (/Image/) requested 175191 times according to apache logs: Total = 53.7159 MB
Images from (/Image/) requested 175807 times according to NGINX logs: Total = 11986.4 MB
Awstats gets data from apache logs only, and it does not read nginx logs. And it is nginx which serves static files. Thus Awstat might need to get data from nginx logs.
The same might be actual for webalizer.
Please fix it.