Loading nixos/modules/services/mail/mailman.nix +1 −1 Original line number Diff line number Diff line Loading @@ -447,7 +447,7 @@ in { enable = lib.mkDefault true; virtualHosts = lib.genAttrs cfg.webHosts (webHost: { locations = { ${cfg.serve.virtualRoot}.extraConfig = "uwsgi_pass unix:/run/mailman-web.socket;"; ${cfg.serve.virtualRoot}.uwsgiPass = "unix:/run/mailman-web.socket"; "${lib.removeSuffix "/" cfg.serve.virtualRoot}/static/".alias = webSettings.STATIC_ROOT + "/"; }; }); Loading nixos/modules/services/web-servers/nginx/default.nix +54 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ let REDIRECT_STATUS = "200"; }; recommendedProxyConfig = pkgs.writeText "nginx-recommended-proxy-headers.conf" '' recommendedProxyConfig = pkgs.writeText "nginx-recommended-proxy_set_header-headers.conf" '' proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; Loading Loading @@ -240,6 +240,14 @@ let include ${recommendedProxyConfig}; ''} ${optionalString cfg.recommendedUwsgiSettings '' uwsgi_connect_timeout ${cfg.uwsgiTimeout}; uwsgi_send_timeout ${cfg.uwsgiTimeout}; uwsgi_read_timeout ${cfg.uwsgiTimeout}; uwsgi_param HTTP_CONNECTION ""; include ${cfg.package}/conf/uwsgi_params; ''} ${optionalString (cfg.mapHashBucketSize != null) '' map_hash_bucket_size ${toString cfg.mapHashBucketSize}; ''} Loading Loading @@ -444,6 +452,13 @@ let proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; ''} ${optionalString (config.uwsgiPass != null && !cfg.uwsgiResolveWhileRunning) "uwsgi_pass ${config.uwsgiPass};" } ${optionalString (config.uwsgiPass != null && cfg.uwsgiResolveWhileRunning) '' set $nix_proxy_target "${config.uwsgiPass}"; uwsgi_pass $nix_proxy_target; ''} ${concatStringsSep "\n" (mapAttrsToList (n: v: ''fastcgi_param ${n} "${v}";'') (optionalAttrs (config.fastcgiParams != {}) Loading @@ -455,6 +470,7 @@ let ${optionalString (config.return != null) "return ${toString config.return};"} ${config.extraConfig} ${optionalString (config.proxyPass != null && config.recommendedProxySettings) "include ${recommendedProxyConfig};"} ${optionalString (config.uwsgiPass != null && config.recommendedUwsgiSettings) "include ${cfg.package}/conf/uwsgi_params;"} ${mkBasicAuth "sublocation" config} } '') (sortProperties (mapAttrsToList (k: v: v // { location = k; }) locations))); Loading Loading @@ -555,6 +571,23 @@ in ''; }; recommendedUwsgiSettings = mkOption { default = false; type = types.bool; description = '' Whether to enable recommended uwsgi settings if a vhost does not specify the option manually. ''; }; uwsgiTimeout = mkOption { type = types.str; default = "60s"; example = "20s"; description = '' Change the uwsgi related timeouts in recommendedUwsgiSettings. ''; }; defaultListen = mkOption { type = with types; listOf (submodule { options = { Loading Loading @@ -864,6 +897,16 @@ in ''; }; uwsgiResolveWhileRunning = mkOption { type = types.bool; default = false; description = '' Resolves domains of uwsgi targets at runtime and not only at start, you have to set services.nginx.resolver, too. ''; }; mapHashBucketSize = mkOption { type = types.nullOr (types.enum [ 32 64 128 ]); default = null; Loading Loading @@ -1161,6 +1204,16 @@ in ''; } { assertion = all (host: all (location: !(location.proxyPass != null && location.uwsgiPass != null)) (attrValues host.locations)) (attrValues virtualHosts); message = '' Options services.nginx.service.virtualHosts.<name>.proxyPass and services.nginx.virtualHosts.<name>.uwsgiPass are mutually exclusive. ''; } { assertion = cfg.package.pname != "nginxQuic" && cfg.package.pname != "angieQuic" -> !(cfg.enableQuicBPF); message = '' Loading nixos/modules/services/web-servers/nginx/location-options.nix +19 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,16 @@ with lib; ''; }; uwsgiPass = mkOption { type = types.nullOr types.str; default = null; example = "unix:/run/example/example.sock"; description = '' Adds uwsgi_pass directive and sets recommended proxy headers if recommendedUwsgiSettings is enabled. ''; }; index = mkOption { type = types.nullOr types.str; default = null; Loading Loading @@ -134,5 +144,14 @@ with lib; Enable recommended proxy settings. ''; }; recommendedUwsgiSettings = mkOption { type = types.bool; default = config.services.nginx.recommendedUwsgiSettings; defaultText = literalExpression "config.services.nginx.recommendedUwsgiSettings"; description = '' Enable recommended uwsgi settings. ''; }; }; } Loading
nixos/modules/services/mail/mailman.nix +1 −1 Original line number Diff line number Diff line Loading @@ -447,7 +447,7 @@ in { enable = lib.mkDefault true; virtualHosts = lib.genAttrs cfg.webHosts (webHost: { locations = { ${cfg.serve.virtualRoot}.extraConfig = "uwsgi_pass unix:/run/mailman-web.socket;"; ${cfg.serve.virtualRoot}.uwsgiPass = "unix:/run/mailman-web.socket"; "${lib.removeSuffix "/" cfg.serve.virtualRoot}/static/".alias = webSettings.STATIC_ROOT + "/"; }; }); Loading
nixos/modules/services/web-servers/nginx/default.nix +54 −1 Original line number Diff line number Diff line Loading @@ -96,7 +96,7 @@ let REDIRECT_STATUS = "200"; }; recommendedProxyConfig = pkgs.writeText "nginx-recommended-proxy-headers.conf" '' recommendedProxyConfig = pkgs.writeText "nginx-recommended-proxy_set_header-headers.conf" '' proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; Loading Loading @@ -240,6 +240,14 @@ let include ${recommendedProxyConfig}; ''} ${optionalString cfg.recommendedUwsgiSettings '' uwsgi_connect_timeout ${cfg.uwsgiTimeout}; uwsgi_send_timeout ${cfg.uwsgiTimeout}; uwsgi_read_timeout ${cfg.uwsgiTimeout}; uwsgi_param HTTP_CONNECTION ""; include ${cfg.package}/conf/uwsgi_params; ''} ${optionalString (cfg.mapHashBucketSize != null) '' map_hash_bucket_size ${toString cfg.mapHashBucketSize}; ''} Loading Loading @@ -444,6 +452,13 @@ let proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; ''} ${optionalString (config.uwsgiPass != null && !cfg.uwsgiResolveWhileRunning) "uwsgi_pass ${config.uwsgiPass};" } ${optionalString (config.uwsgiPass != null && cfg.uwsgiResolveWhileRunning) '' set $nix_proxy_target "${config.uwsgiPass}"; uwsgi_pass $nix_proxy_target; ''} ${concatStringsSep "\n" (mapAttrsToList (n: v: ''fastcgi_param ${n} "${v}";'') (optionalAttrs (config.fastcgiParams != {}) Loading @@ -455,6 +470,7 @@ let ${optionalString (config.return != null) "return ${toString config.return};"} ${config.extraConfig} ${optionalString (config.proxyPass != null && config.recommendedProxySettings) "include ${recommendedProxyConfig};"} ${optionalString (config.uwsgiPass != null && config.recommendedUwsgiSettings) "include ${cfg.package}/conf/uwsgi_params;"} ${mkBasicAuth "sublocation" config} } '') (sortProperties (mapAttrsToList (k: v: v // { location = k; }) locations))); Loading Loading @@ -555,6 +571,23 @@ in ''; }; recommendedUwsgiSettings = mkOption { default = false; type = types.bool; description = '' Whether to enable recommended uwsgi settings if a vhost does not specify the option manually. ''; }; uwsgiTimeout = mkOption { type = types.str; default = "60s"; example = "20s"; description = '' Change the uwsgi related timeouts in recommendedUwsgiSettings. ''; }; defaultListen = mkOption { type = with types; listOf (submodule { options = { Loading Loading @@ -864,6 +897,16 @@ in ''; }; uwsgiResolveWhileRunning = mkOption { type = types.bool; default = false; description = '' Resolves domains of uwsgi targets at runtime and not only at start, you have to set services.nginx.resolver, too. ''; }; mapHashBucketSize = mkOption { type = types.nullOr (types.enum [ 32 64 128 ]); default = null; Loading Loading @@ -1161,6 +1204,16 @@ in ''; } { assertion = all (host: all (location: !(location.proxyPass != null && location.uwsgiPass != null)) (attrValues host.locations)) (attrValues virtualHosts); message = '' Options services.nginx.service.virtualHosts.<name>.proxyPass and services.nginx.virtualHosts.<name>.uwsgiPass are mutually exclusive. ''; } { assertion = cfg.package.pname != "nginxQuic" && cfg.package.pname != "angieQuic" -> !(cfg.enableQuicBPF); message = '' Loading
nixos/modules/services/web-servers/nginx/location-options.nix +19 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,16 @@ with lib; ''; }; uwsgiPass = mkOption { type = types.nullOr types.str; default = null; example = "unix:/run/example/example.sock"; description = '' Adds uwsgi_pass directive and sets recommended proxy headers if recommendedUwsgiSettings is enabled. ''; }; index = mkOption { type = types.nullOr types.str; default = null; Loading Loading @@ -134,5 +144,14 @@ with lib; Enable recommended proxy settings. ''; }; recommendedUwsgiSettings = mkOption { type = types.bool; default = config.services.nginx.recommendedUwsgiSettings; defaultText = literalExpression "config.services.nginx.recommendedUwsgiSettings"; description = '' Enable recommended uwsgi settings. ''; }; }; }