From 30b4139d23747905ad178374886ed7a6f2c34653 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 14 Sep 2023 21:43:20 +0200 Subject: [PATCH] Add common nginx configuration for upcoming nginx hosts --- config/common/nginx.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 config/common/nginx.nix diff --git a/config/common/nginx.nix b/config/common/nginx.nix new file mode 100644 index 0000000..6d4465d --- /dev/null +++ b/config/common/nginx.nix @@ -0,0 +1,26 @@ +# Common nginx configuration. +# Sources for this configuration: +# - https://nixos.wiki/wiki/Nginx +# - Julians nginx Ansible role + +{ config, pkgs, ... }: + +{ + services.nginx = { + # See here: + # - https://github.com/NixOS/nixpkgs/blob/2809915f19bd120f840bea27fbf915a546c08878/nixos/modules/services/web-servers/nginx/default.nix#L178 + # apparently follows: + # - https://ssl-config.mozilla.org/ + recommendedTlsSettings = true; + # See here: + # - https://github.com/NixOS/nixpkgs/blob/2809915f19bd120f840bea27fbf915a546c08878/nixos/modules/services/web-servers/nginx/default.nix#L203 + # - https://docs.nginx.com/nginx/admin-guide/web-server/compression/ + recommendedGzipSettings = true; + # See here: + # - https://github.com/NixOS/nixpkgs/blob/2809915f19bd120f840bea27fbf915a546c08878/nixos/modules/services/web-servers/nginx/default.nix#L166 + recommendedOptimisation = true; + # See here: + # - https://github.com/NixOS/nixpkgs/blob/2809915f19bd120f840bea27fbf915a546c08878/nixos/modules/services/web-servers/nginx/default.nix#L223 + recommendedProxySettings = true; + }; +}