nixos-config/config/services/nginx.nix

30 lines
857 B
Nix
Raw Normal View History

2022-01-14 19:47:44 +00:00
{ pkgs, ... }: {
services.nginx = {
additionalModules = [ pkgs.nginxModules.brotli ];
2022-01-22 13:10:41 +00:00
clientMaxBodySize = "1g";
2022-01-14 19:47:44 +00:00
enable = true;
2022-01-14 20:18:45 +00:00
appendHttpConfig = ''
2022-01-14 19:47:44 +00:00
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;
'';
2022-01-14 20:54:49 +00:00
# package = pkgs.nginxQuic;
2022-01-14 19:47:44 +00:00
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
resolver.addresses = [ "127.0.0.1" "[::1]" ];
sslProtocols = "TLSv1.3";
};
2022-01-14 19:51:43 +00:00
networking.firewall.allowedTCPPorts = [ 80 443 ];
networking.firewall.allowedUDPPorts = [ 443 ];
2022-01-14 19:47:44 +00:00
}