 +
 +        *ptr2++ = '"';
 +        *ptr2 = '\0';
- 
--    etag->value.len = ngx_sprintf(etag->value.data, "\"%xT-%xO\"",
--                                  r->headers_out.last_modified_time,
--                                  r->headers_out.content_length_n)
--                      - etag->value.data;
++
 +        etag->value.len = ngx_strlen(ptr1);
 +        etag->value.data = ngx_pnalloc(r->pool, etag->value.len);
 +

From 3ed81ef9e973247d0c95bf240b3bd2e640f2605a Mon Sep 17 00:00:00 2001
From: Yegor Timoshenko <yegortimoshenko@riseup.net>
Date: Fri, 28 Sep 2018 03:27:04 +0000
Subject: [PATCH] If root is in Nix store, set ETag to its path hash

---
 src/http/ngx_http_core_module.c | 56 +++++++++++++++++++++++++++------
 1 file changed, 47 insertions(+), 9 deletions(-)

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index c57ec00c..d996d7e3 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1583,6 +1583,7 @@ ngx_http_set_etag(ngx_http_request_t *r)

     r->headers_out.etag = etag;
 
-- 
2.19.0

