Compare commits
4 commits
ae0c039c5b
...
42bee7ac3e
Author | SHA1 | Date | |
---|---|---|---|
|
42bee7ac3e | ||
|
db486eb933 | ||
|
3ff1137b21 | ||
|
65b884b9fe |
4 changed files with 31 additions and 2 deletions
|
@ -7,7 +7,7 @@ test -n "$ACCESS_LOGS_FLAGS" || exit 1
|
||||||
umask 007
|
umask 007
|
||||||
|
|
||||||
# Copy default database
|
# Copy default database
|
||||||
install -m 640 /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3
|
install -m 640 -o nobody /var/lib/access_log.sqlite3 /var/log/access_log.sqlite3
|
||||||
|
|
||||||
# Read from fifo and load into database
|
# Read from fifo and load into database
|
||||||
daemonize -p /run/access_logd.pid -u nobody /usr/bin/access_log $ACCESS_LOGS_FLAGS
|
daemonize -p /run/access_logd.pid -u nobody /usr/local/bin/syslogize /usr/bin/access_log $ACCESS_LOGS_FLAGS
|
||||||
|
|
3
nginx/access_logd_0.5.0.conf
Normal file
3
nginx/access_logd_0.5.0.conf
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
log_format access_logd escape=json '{"host":"$host","msec":$msec,"server_protocol":"$server_protocol","request_method":"$request_method","request_completion":"$request_completion","uri":"$uri","query_string":"$query_string","status":$status,"sent_http_content_type":"$sent_http_content_type","sent_http_content_encoding":"$sent_http_content_encoding","sent_http_etag":"$sent_http_etag","sent_http_last_modified":"$sent_http_last_modified","http_accept":"$http_accept","http_accept_encoding":"$http_accept_encoding","http_accept_language":"$http_accept_language","http_pragma":"$http_pragma","http_cache_control":"$http_cache_control","http_if_none_match":"$http_if_none_match","http_dnt":"$http_dnt","http_user_agent":"$http_user_agent","http_origin":"$http_origin","http_referer":{"origin":"$http_origin","referrer":"$http_referer","policy":"origin-when-cross-origin"},"request_time":$request_time,"bytes_sent":$bytes_sent,"body_bytes_sent":$body_bytes_sent,"request_length":$request_length,"http_connection":"$http_connection","pipe":"$pipe","connection_requests":$connection_requests,"geoip2_data_country_name":"$geoip2_data_country_name","geoip2_data_country_iso_code":"$geoip2_data_country_iso_code","geoip2_data_city_name":"$geoip2_data_city_name","ssl_server_name":"$ssl_server_name","ssl_protocol":"$ssl_protocol","ssl_early_data":"$ssl_early_data","ssl_session_reused":"$ssl_session_reused","ssl_curves":"$ssl_curves","ssl_ciphers":"$ssl_ciphers","ssl_cipher":"$ssl_cipher","sent_http_x_xss_protection":"$sent_http_x_xss_protection","sent_http_x_frame_options":"$sent_http_x_frame_options","sent_http_x_content_type_options":"$sent_http_x_content_type_options","sent_http_strict_transport_security":"$sent_http_strict_transport_security","nginx_version":"$nginx_version","pid":"$pid","remote_user":"$remote_user","request_uri":"$request_uri"}';
|
||||||
|
|
||||||
|
access_log syslog:server=unix:/tmp/access_log.socket,nohostname access_logd;
|
25
nginx/fastcgi_params
Normal file
25
nginx/fastcgi_params
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
fastcgi_param QUERY_STRING $query_string;
|
||||||
|
fastcgi_param REQUEST_METHOD $request_method;
|
||||||
|
fastcgi_param CONTENT_TYPE $content_type;
|
||||||
|
fastcgi_param CONTENT_LENGTH $content_length;
|
||||||
|
|
||||||
|
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||||
|
fastcgi_param REQUEST_URI $request_uri;
|
||||||
|
fastcgi_param DOCUMENT_URI $document_uri;
|
||||||
|
fastcgi_param DOCUMENT_ROOT $document_root;
|
||||||
|
fastcgi_param SERVER_PROTOCOL $server_protocol;
|
||||||
|
fastcgi_param REQUEST_SCHEME $scheme;
|
||||||
|
fastcgi_param HTTPS $https if_not_empty;
|
||||||
|
|
||||||
|
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
|
||||||
|
fastcgi_param SERVER_SOFTWARE nginx;
|
||||||
|
|
||||||
|
# Anonymous
|
||||||
|
fastcgi_param REMOTE_ADDR 127.0.0.1;
|
||||||
|
fastcgi_param REMOTE_PORT $remote_port;
|
||||||
|
fastcgi_param SERVER_ADDR $server_addr;
|
||||||
|
fastcgi_param SERVER_PORT $server_port;
|
||||||
|
fastcgi_param SERVER_NAME $host;
|
||||||
|
|
||||||
|
# PHP only, required if PHP was built with --enable-force-cgi-redirect
|
||||||
|
fastcgi_param REDIRECT_STATUS 200;
|
|
@ -38,6 +38,7 @@ http {
|
||||||
|
|
||||||
geoip2 /usr/share/GeoIP/GeoLite2-Country.mmdb {
|
geoip2 /usr/share/GeoIP/GeoLite2-Country.mmdb {
|
||||||
$geoip2_data_country_name country names en;
|
$geoip2_data_country_name country names en;
|
||||||
|
$geoip2_data_country_iso_code country iso_code;
|
||||||
}
|
}
|
||||||
|
|
||||||
geoip2 /usr/share/GeoIP/GeoLite2-City.mmdb {
|
geoip2 /usr/share/GeoIP/GeoLite2-City.mmdb {
|
||||||
|
|
Loading…
Reference in a new issue