From e26d4f9722453ca8e282abcb48179ff6b110825b Mon Sep 17 00:00:00 2001 From: Ivan Reshetnikov Date: Mon, 4 Mar 2024 19:35:42 +0500 Subject: [PATCH] feat: enable nginx access log --- nixos/programs/nginx.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nixos/programs/nginx.nix b/nixos/programs/nginx.nix index c7b6852..a680b3c 100644 --- a/nixos/programs/nginx.nix +++ b/nixos/programs/nginx.nix @@ -16,6 +16,15 @@ in { recommendedGzipSettings = true; recommendedProxySettings = true; + appendHttpConfig = '' + map $status $loggable { + ~^[23] 0; + default 1; + } + + access_log /var/log/nginx/access.log combined if=$loggable; + ''; + commonHttpConfig = '' # Add HSTS header with preloading to HTTPS requests. # Adding this header to HTTP requests is discouraged