Cdnstats
CDNStat is a daemon collecting various statistics from nginx requests: request count, sent bytes, referer, URI path.
Install / Use
/learn @antage/CdnstatsREADME
CDNStats
CDNStat is a daemon collecting various statistics from nginx requests: request count, sent bytes, referer, URI path.
Installation
git clone git://github.com/antage/cdnstats
GOPATH=./cdnstats go install cdnstats
cdnstats/bin/cdnstats -h x.x.x.x -p pppp
Where x.x.x.x is host name, pppp is port number. Default values: 127.0.0.1:9090
Now you can open browser at http://x.x.x.x:pppp/ for web-page displaying statistics.
How to setup Nginx?
Configuration example:
server {
location / {
root /var/www;
post_action @stats; # after each request send information to cdnstats
}
location @stats {
proxy_pass http://x.x.x.x:pppp/collect?bucket=[bucket name]&s=[hostname]&uri=$uri;
# don't wait too long
proxy_send_timeout 5s;
proxy_read_timeout 5s;
# optional header if you use domain name instead of ip-address x.x.x.x
# proxy_set_header Host cdnstat.example.org;
# this headers are used by cdnstats
proxy_set_header X-Bytes-Sent $body_bytes_sent;
# Referer header is sent implicitly
# delete unused headers
proxy_set_header Accept "";
proxy_set_header Accept-Encoding "";
proxy_set_header Accept-Language "";
proxy_set_header Accept-Charset "";
proxy_set_header User-Agent "";
proxy_set_header Cookie "";
# don't send POST-request body
proxy_pass_request_body off;
}
}
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
