monitoring
This commit is contained in:
parent
11a0786f03
commit
7b8476c23b
1 changed files with 4 additions and 2 deletions
|
@ -1,5 +1,7 @@
|
||||||
{ config, ... }: let
|
{ config, ... }: let
|
||||||
format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"";
|
format = ''
|
||||||
|
$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\"
|
||||||
|
'';
|
||||||
in {
|
in {
|
||||||
services.prometheus.exporters.nginxlog = {
|
services.prometheus.exporters.nginxlog = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -19,7 +21,7 @@ in {
|
||||||
services.nginx.commonHttpConfig = ''
|
services.nginx.commonHttpConfig = ''
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
log_format combined "${format}";
|
log_format combined "${format}";
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [ 14201 ];
|
networking.firewall.allowedTCPPorts = [ 14201 ];
|
||||||
|
|
Loading…
Add table
Reference in a new issue