those who nginx:

This commit is contained in:
Sakooooo 2024-12-31 18:45:03 +04:00
parent 405868d8aa
commit 3ec8cfbb80
Signed by: sako
GPG key ID: 3FD715D87D7725E0
2 changed files with 31 additions and 1 deletions

View file

@ -2,7 +2,7 @@
with lib; with lib;
let cfg = config.void.server; let cfg = config.void.server;
in { in {
imports = [ ./dns ]; imports = [ ./dns ./nginx.nix ];
options.void.server = { isServer = mkEnableOption false; }; options.void.server = { isServer = mkEnableOption false; };

30
modules/server/nginx.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, lib, ... }:
with lib;
let cfg = config.void.server.nginx;
in {
imports = [ ./dns ];
options.void.server.nginx = { enable = mkEnableOption false; };
config = mkIf cfg.enable {
security.acme = {
acceptTerms = true;
defaults.email = "Sayeko@proton.me";
};
services.nginx = {
enable = true;
recommendedTlsSettings = true;
recommendedBrotliSettings = true;
recommendedOptimisation = true;
recommendedGzipSettings = true;
recommendedProxySettings = true;
recommendedZstdSettings = true;
commonHttpConfig = ''
access_log /var/log/nginx/access.log combined_anon buffer=32k flush=5m;
error_log /var/log/nginx/error.log warn;
'';
};
};
}