Add common nginx configuration for upcoming nginx hosts

This commit is contained in:
June 2023-09-14 21:43:20 +02:00
parent 3fd9964110
commit 30b4139d23

26
config/common/nginx.nix Normal file
View file

@ -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;
};
}