nginx: split logs per vhost
This commit is contained in:
parent
3e70f7a0fc
commit
075bc2b6fa
|
@ -1,6 +1,11 @@
|
||||||
{ config, pkgs, ... }:
|
{ lib, config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
services.nginx = {
|
services.nginx =
|
||||||
|
let
|
||||||
|
# manually write the hosts in here since automatic grabbing leads to an unfixable infinite recursion
|
||||||
|
hosts = [ "mail" "rspamd" "chat" "matrix" "kpp" "kurse" "git" "ftp" "users" "pad" "list.pad" "manual" "infoscreen" "kanboard" "kb" "lists" "nc" "oc" "sharepic" "vault" "www" "wiki" ];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
additionalModules = [ pkgs.nginxModules.pam ];
|
additionalModules = [ pkgs.nginxModules.pam ];
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -8,6 +13,14 @@
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
recommendedOptimisation = true;
|
recommendedOptimisation = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
|
# split up nginx access logs per vhost
|
||||||
|
virtualHosts = lib.genAttrs (lib.lists.forEach hosts (h: h + ".ifsr.de")) (host: {
|
||||||
|
extraConfig = ''
|
||||||
|
access_log /var/log/nginx/${host}_access.log;
|
||||||
|
error_log /var/log/nginx/${host}_error.log;
|
||||||
|
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
# appendHttpConfig = ''
|
# appendHttpConfig = ''
|
||||||
# map $remote_addr $remote_addr_anon {
|
# map $remote_addr $remote_addr_anon {
|
||||||
|
|
Loading…
Reference in a new issue