summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2022-11-18 14:58:04 +0100
committerTobias Geerinckx-Rice <me@tobias.gr>2024-09-01 02:00:00 +0200
commit1e4f3c8a7aab004e63b475aeb7310f4f9c833a6b (patch)
tree8868c3e07b52a4e75f888c87985cf4dc289499e8
parentc518c9b2e8a1f49de8c0457b9247995164a3bdc1 (diff)
gnu: nginx: Hide server header.
* gnu/packages/web.scm (nginx)[arguments]: Add a new 'nckx-hide-server-header phase.
-rw-r--r--gnu/packages/web.scm9
1 files changed, 9 insertions, 0 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 1f60e7b5f1..4ba3258600 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -571,6 +571,15 @@ the same, being completely separated from the Internet.")
system ":" release ":" machine)))
#:phases
#~(modify-phases %standard-phases
+ (add-after 'unpack 'nckx-hide-server-header
+ (lambda _
+ (substitute* (list "src/http/ngx_http_header_filter_module.c"
+ "src/http/v2/ngx_http_v2_filter_module.c")
+ ;; Just in case the next rule is insufficient: lie badly.
+ ;; XXX figure out if at all needed.
+ (("\"Server: .*;") "\"Server: Apache/2.4.9 (Unix)\";")
+ ;; Never send Server: headers.
+ (("r->headers_out\\.server == NULL") "0"))))
(add-before 'configure 'patch-/bin/sh
(lambda _
(substitute* "auto/feature"