Add nginx to servers

This commit is contained in:
Charlotte 🦝 Delenk 2022-01-14 20:47:44 +01:00
parent 601e3c55c1
commit f4c07fb59c
Signed by: darkkirb
GPG key ID: 015E3768A70AFBC5
3 changed files with 32 additions and 3 deletions

View file

@ -1,2 +1,6 @@
# Configuration unique to servers
{ ... }: { }
{ ... }: {
imports = [
./services/nginx.nix
];
}

View file

@ -1,2 +0,0 @@
# Mostly future-proofing, but also for the transition to this infra
{ ... }: { }

27
config/services/nginx.nix Normal file
View file

@ -0,0 +1,27 @@
{ pkgs, ... }: {
services.nginx = {
additionalModules = [ pkgs.nginxModules.brotli ];
clientMaxBodySize = "100m";
enable = true;
httpConfig = ''
brotli on;
brotli_types
application/atom+xml
application/javascript
application/json
application/xml
application/xml+rss
image/svg+xml
text/css
text/javascript
text/plain
text/xml;
'';
package = pkgs.nginxQuic;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
resolver.addresses = [ "127.0.0.1" "[::1]" ];
sslProtocols = "TLSv1.3";
};
}