about summary refs log tree commit diff
path: root/modules/nixos/nginx.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-11-12 17:50:43 +0300
committerAzat Bahawi <azat@bahawi.net>2023-11-12 17:50:43 +0300
commit011c1632f3762e1bc1ecfdee9d9f3b3f44be74e5 (patch)
treee9d7d5955f25f82cdb671f1c44da663d2d839485 /modules/nixos/nginx.nix
parent2023-11-09 (diff)
2023-11-12
Diffstat (limited to '')
-rw-r--r--modules/nixos/nginx.nix17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/nixos/nginx.nix b/modules/nixos/nginx.nix
index 9ca6936..05c6a06 100644
--- a/modules/nixos/nginx.nix
+++ b/modules/nixos/nginx.nix
@@ -25,6 +25,23 @@ in {
   };
 
   config = mkIf cfg.enable {
+    _module.args.libNginx.config = {
+      internalOnly = ''
+        if ($internal != 1) {
+          return 403;
+        }
+        access_log off;
+      '';
+      appendHead = text: ''
+        sub_filter '</head>' '${lib.concatStrings text}</head>';
+        sub_filter_once on;
+      '';
+      noProxyBuffering = ''
+        proxy_buffering off;
+        proxy_cache off;
+      '';
+    };
+
     services = {
       nginx = {
         enable = true;

Consider giving Nix/NixOS a try! <3