From 816997b74f6ca20af1010bc423eb23774dcc268c Mon Sep 17 00:00:00 2001 From: Daniel Olsen Date: Wed, 13 Sep 2023 11:01:09 +0200 Subject: [PATCH] bicep/nginx: increase workers and enable modern compression Should decrease latency --- hosts/bicep/services/nginx/default.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hosts/bicep/services/nginx/default.nix b/hosts/bicep/services/nginx/default.nix index a99affc..4eb1e03 100644 --- a/hosts/bicep/services/nginx/default.nix +++ b/hosts/bicep/services/nginx/default.nix @@ -19,11 +19,27 @@ "[::1]" ]; + appendConfig = '' + pcre_jit on; + worker_processes 8; + worker_rlimit_nofile 8192; + ''; + + eventsConfig = '' + multi_accept on; + worker_connections 4096; + ''; + recommendedProxySettings = true; recommendedTlsSettings = true; recommendedGzipSettings = true; + recommendedBrotliSettings = true; recommendedOptimisation = true; }; networking.firewall.allowedTCPPorts = [ 80 443 ]; + + systemd.services.nginx.serviceConfig = { + LimitNOFILE = 65536; + }; }