Created
December 7, 2017 16:57
-
-
Save Gummibeer/12b55438e36009206bdc939159775706 to your computer and use it in GitHub Desktop.
Revisions
-
Gummibeer created this gist
Dec 7, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ * https://github.com/vozlt/nginx-module-vts * https://serversforhackers.com/c/compiling-third-party-modules-into-nginx * https://askubuntu.com/a/40050 * https://www.cambus.net/log-rotation-directly-within-nginx-configuration-file/ **nginx.conf** ``` http { vhost_traffic_status_zone; vhost_traffic_status_dump /var/log/nginx/vts.db; } ``` **vhost.conf** ``` server { if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") { set $year $1; set $month $2; set $day $3; } vhost_traffic_status_filter_by_set_key $year year::$server_name; vhost_traffic_status_filter_by_set_key $year-$month month::$server_name; vhost_traffic_status_filter_by_set_key $year-$month-$day day::$server_name; location /nginx-status { vhost_traffic_status_bypass_limit on; vhost_traffic_status_bypass_stats on; vhost_traffic_status_display; vhost_traffic_status_display_format html; allow 127.0.0.1; deny all; } } ```