If we inserted "Last-Modified" in r->headers_out.headers, don't forget to set the r->headers_out.last_modified pointer to it.
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c index d061fff..9389934 100644 --- a/src/http/modules/ngx_http_headers_filter_module.c +++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -385,6 +385,8 @@ return NGX_ERROR; } + *old = h; + } else { h = *old;