git.iko.soy/typeable/nixpkgs
on master help sign in
nginxModules.http_proxy_connect_module: init

This adds the nginx module `ngx_http_proxy_connect_module` which allows to tunnel HTTPS through an nginx proxy[1]. As this module contained patches for several nginx version, some minor adjustments were needed: * Allowed each entry in `nginxModules` to provide patches. * Added an optional `supports` attribute to ensure that each module can determine if it supports the currently built nginx version (e.g. stable 1.14 ATM or mainline 1.15 ATM). [1] https://github.com/chobits/ngx_http_proxy_connect_module

commit37867dba74377988594b18657ae68e3bfef24755 authorMaximilian Bosch <maximilian@mbosch.me> dateMon 21 Jan 2019, 13:02 (8 years ago) parent6b1d7e9
2 files changed+38−2
pkgs/servers/http/nginx/generic.nix+13−2 pkgs/servers/http/nginx/modules.nix+25
pkgs/servers/http/nginx/generic.nix+13−2
@@ -9,6 +9,17 @@
99
1010with stdenv.lib;
1111
12+let
13+
14+ mapModules = attrPath: flip concatMap modules
15+ (mod:
16+ let supports = mod.supports or (_: true);
17+ in
18+ if supports version then mod.${attrPath} or []
19+ else throw "Module at ${toString mod.src} does not support nginx version ${version}!");
20+
21+in
22+
1223stdenv.mkDerivation {
1324 name = "nginx-${version}";
1425
@@ -18,7 +29,7 @@ stdenv.mkDerivation {
1829 };
1930
2031 buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip ]
21− ++ concatMap (mod: mod.inputs or []) modules;
32+ ++ mapModules "inputs";
2233
2334 configureFlags = [
2435 "--with-http_ssl_module"
@@ -77,7 +88,7 @@ stdenv.mkDerivation {
7788 url = "https://raw.githubusercontent.com/openwrt/packages/master/net/nginx/patches/103-sys_nerr.patch";
7889 sha256 = "0s497x6mkz947aw29wdy073k8dyjq8j99lax1a1mzpikzr4rxlmd";
7990 })
80− ];
91+ ] ++ mapModules "patches";
8192
8293 hardeningEnable = optional (!stdenv.isDarwin) "pie";
8394
pkgs/servers/http/nginx/modules.nix+25
@@ -1,5 +1,22 @@
11{ fetchFromGitHub, lib, pkgs }:
22
3+let
4+
5+ http_proxy_connect_module_generic = patchName: rec {
6+ src = fetchFromGitHub {
7+ owner = "chobits";
8+ repo = "ngx_http_proxy_connect_module";
9+ rev = "8201639082cba702211585b03d4cc7bc51c65167";
10+ sha256 = "0z71x3xnlczrr2kq43w3drxj9g14fkk4jz66x921v0yb8r9mnn5a";
11+ };
12+
13+ patches = [
14+ "${src}/patch/${patchName}.patch"
15+ ];
16+ };
17+
18+in
19+
320{
421 brotli = {
522 src = let gitsrc = pkgs.fetchFromGitHub {
@@ -318,4 +335,12 @@
318335 sha256 = "1jq2s9k7hah3b317hfn9y3g1q4g4x58k209psrfsqs718a9sw8c7";
319336 };
320337 };
338+
339+ http_proxy_connect_module_v15 = http_proxy_connect_module_generic "proxy_connect_rewrite_1015" // {
340+ supports = with lib.versions; version: major version == "1" && minor version == "15";
341+ };
342+
343+ http_proxy_connect_module_v14 = http_proxy_connect_module_generic "proxy_connect_rewrite_1014" // {
344+ supports = with lib.versions; version: major version == "1" && minor version == "14";
345+ };
321346}