Adds more configuration properties to the NixOS configuration for Nginx
Find a file
2026-08-05 22:14:50 -05:00
src Assertion Gaming 2026-08-05 22:14:50 -05:00
test Test VM Gaming 2026-08-05 22:14:23 -05:00
.gitignore Test VM Gaming 2026-08-05 22:14:23 -05:00
flake.nix Assertion Gaming 2026-08-05 22:14:50 -05:00
README.md Add more proxy configuration options 2026-08-05 18:04:09 -04:00

nginx-utils

A Nix flake that adds more configuration properties to the NixOS configuration for Nginx.

Features

Virtual Host Config Attributes

  • The following Nginx attributes for virtualHosts can now be configured in Nix, rather than just extraConfig:
    • allow and deny lists for IP addresses
    • proxySetHeaders attribute set for mapping values to headers
    • proxyBuffering toggle
    • proxyHttpVersion setting
  • websocketLocations list to automatically configure the default recommended websocket headers on your websocket endpoints.
    • This will create a location that proxyPasses to the same proxy on / and set proxyWebsockets to true.

Usage

If you're using a flake to manage your system configuration, you can add this as a flake:

{
    inputs = {
        # nixpkgs...
        nginx-utils.url = "git+https://forge.cptlobster.dev/cptlobster/nginx-utils";
    };
    outputs = inputs @ {
        # ...
        nginx-utils
    }: {
        nixosConfigurations.HOSTNAME = nixpkgs.lib.nixosSystem rec {
            system = "x86_64-linux";
            modules = [
                nginx-utils.nixosModules.default
                # ...
            ];
        };
    };
}

You can then start using the added configuration parameters in your system configuration.