nginx: if root is in Nix store, use path's hash as ETag

Resolves #25485. Usage example:

$ realpath /var/www
/nix/store/wnrhnnpdj3x50j5xz38zp1qxs1ygwccw-site
$ curl --head localhost
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 28 Sep 2018 06:09:25 GMT
Content-Type: text/html
Content-Length: 50
Last-Modified: Thu, 01 Jan 1970 00:00:01 GMT
Connection: keep-alive
ETag: "wnrhnnpdj3x50j5xz38zp1qxs1ygwccw"
Accept-Ranges: bytes
This commit is contained in:
Yegor Timoshenko
2019-04-18 09:40:06 +02:00
committed by aszlig
parent b050097edf
commit 135d54f535
2 changed files with 90 additions and 1 deletions
+3 -1
View File
@@ -75,7 +75,9 @@ stdenv.mkDerivation {
preConfigure = (concatMapStringsSep "\n" (mod: mod.preConfigure or "") modules);
patches = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
patches = [
./nix-etag-1.15.4.patch
] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
(fetchpatch {
url = "https://raw.githubusercontent.com/openwrt/packages/master/net/nginx/patches/102-sizeof_test_fix.patch";
sha256 = "0i2k30ac8d7inj9l6bl0684kjglam2f68z8lf3xggcc2i5wzhh8a";