Skip to content

Instantly share code, notes, and snippets.

@jakubpawlowicz
Created December 5, 2018 14:40
Show Gist options
  • Save jakubpawlowicz/5a71bffc4b743c580fa769ad7ef9990c to your computer and use it in GitHub Desktop.
Save jakubpawlowicz/5a71bffc4b743c580fa769ad7ef9990c to your computer and use it in GitHub Desktop.
How to add brotli module to nginx under NixOS
{ config, pkgs, ... }:
{
nixpkgs.overlays = [
(self: super: {
nginxStable = super.nginxStable.override {
modules = [
self.nginxModules.brotli
];
};
})
];
services.nginx.enable = true;
services.nginx.commonHttpConfig = ''
brotli on;
brotli_static on;
brotli_types application/json application/javascript application/xml application/xml+rss image/svg+xml text/css text/html text/javascript text/plain text/xml;
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment