Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 81e2fb53038d
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b511664a745d
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Mar 29, 2019

  1. 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
    Ma27 committed Mar 29, 2019
    Copy the full SHA
    37867db View commit details

Commits on Mar 30, 2019

  1. Merge pull request #54420 from Ma27/package-nginx-http-proxy-connect-…

    …module
    
    nginxModules.http_proxy_connect_module: init
    infinisil authored Mar 30, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    b511664 View commit details
Showing with 38 additions and 2 deletions.
  1. +13 −2 pkgs/servers/http/nginx/generic.nix
  2. +25 −0 pkgs/servers/http/nginx/modules.nix
15 changes: 13 additions & 2 deletions pkgs/servers/http/nginx/generic.nix
Original file line number Diff line number Diff line change
@@ -9,6 +9,17 @@

with stdenv.lib;

let

mapModules = attrPath: flip concatMap modules
(mod:
let supports = mod.supports or (_: true);
in
if supports version then mod.${attrPath} or []
else throw "Module at ${toString mod.src} does not support nginx version ${version}!");

in

stdenv.mkDerivation {
name = "nginx-${version}";

@@ -18,7 +29,7 @@ stdenv.mkDerivation {
};

buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip ]
++ concatMap (mod: mod.inputs or []) modules;
++ mapModules "inputs";

configureFlags = [
"--with-http_ssl_module"
@@ -77,7 +88,7 @@ stdenv.mkDerivation {
url = "https://raw.githubusercontent.com/openwrt/packages/master/net/nginx/patches/103-sys_nerr.patch";
sha256 = "0s497x6mkz947aw29wdy073k8dyjq8j99lax1a1mzpikzr4rxlmd";
})
];
] ++ mapModules "patches";

hardeningEnable = optional (!stdenv.isDarwin) "pie";

25 changes: 25 additions & 0 deletions pkgs/servers/http/nginx/modules.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
{ fetchFromGitHub, lib, pkgs }:

let

http_proxy_connect_module_generic = patchName: rec {
src = fetchFromGitHub {
owner = "chobits";
repo = "ngx_http_proxy_connect_module";
rev = "8201639082cba702211585b03d4cc7bc51c65167";
sha256 = "0z71x3xnlczrr2kq43w3drxj9g14fkk4jz66x921v0yb8r9mnn5a";
};

patches = [
"${src}/patch/${patchName}.patch"
];
};

in

{
brotli = {
src = let gitsrc = pkgs.fetchFromGitHub {
@@ -318,4 +335,12 @@
sha256 = "1jq2s9k7hah3b317hfn9y3g1q4g4x58k209psrfsqs718a9sw8c7";
};
};

http_proxy_connect_module_v15 = http_proxy_connect_module_generic "proxy_connect_rewrite_1015" // {
supports = with lib.versions; version: major version == "1" && minor version == "15";
};

http_proxy_connect_module_v14 = http_proxy_connect_module_generic "proxy_connect_rewrite_1014" // {
supports = with lib.versions; version: major version == "1" && minor version == "14";
};
}