GNU bug report logs -
#56164
[PATCH] services: nginx: Add support for extra content in upstream blocks.
Previous Next
Reported by: Christopher Baines <mail <at> cbaines.net>
Date: Thu, 23 Jun 2022 11:46:02 UTC
Severity: normal
Tags: patch
Done: Christopher Baines <mail <at> cbaines.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 56164 in the body.
You can then email your comments to 56164 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#56164
; Package
guix-patches
.
(Thu, 23 Jun 2022 11:46:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Christopher Baines <mail <at> cbaines.net>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Thu, 23 Jun 2022 11:46:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
I'm looking at this as I'd like to use the keepalive functionality.
* gnu/services/web.scm (nginx-upstream-configuration-extra-content): New
procedure.
(emit-nginx-upstream-config): Include the extra-content if applicable.
* doc/guix.texi (NGINX): Document this.
---
doc/guix.texi | 3 +++
gnu/services/web.scm | 14 +++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index bbb7d0764d..0a96ad1852 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -28490,6 +28490,9 @@ prefix @samp{unix:}. For addresses using an IP address or domain name,
the default port is 80, and a different port can be specified
explicitly.
+@item @code{extra-content}
+A string or list of strings to add to the upstream block.
+
@end table
@end deftp
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 4f06d4e0bb..4434fecf02 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -120,6 +120,7 @@ (define-module (gnu services web)
nginx-upstream-configuration?
nginx-upstream-configuration-name
nginx-upstream-configuration-servers
+ nginx-upstream-configuration-extra-content
nginx-location-configuration
nginx-location-configuration?
@@ -517,7 +518,9 @@ (define-record-type* <nginx-upstream-configuration>
nginx-upstream-configuration make-nginx-upstream-configuration
nginx-upstream-configuration?
(name nginx-upstream-configuration-name)
- (servers nginx-upstream-configuration-servers))
+ (servers nginx-upstream-configuration-servers)
+ (extra-content nginx-upstream-configuration-extra-content
+ (default '())))
(define-record-type* <nginx-location-configuration>
nginx-location-configuration make-nginx-location-configuration
@@ -643,6 +646,15 @@ (define (emit-nginx-upstream-config upstream)
(map (lambda (server)
(simple-format #f " server ~A;\n" server))
(nginx-upstream-configuration-servers upstream))
+ (let ((extra-content
+ (nginx-upstream-configuration-extra-content upstream)))
+ (if (and extra-content (not (null? extra-content)))
+ (cons
+ "\n"
+ (map (lambda (line)
+ (simple-format #f " ~A\n" line))
+ (flatten extra-content)))
+ '()))
" }\n"))
(define (flatten . lst)
--
2.36.1
Reply sent
to
Christopher Baines <mail <at> cbaines.net>
:
You have taken responsibility.
(Fri, 01 Jul 2022 08:49:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Christopher Baines <mail <at> cbaines.net>
:
bug acknowledged by developer.
(Fri, 01 Jul 2022 08:49:03 GMT)
Full text and
rfc822 format available.
Message #10 received at 56164-done <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Christopher Baines <mail <at> cbaines.net> writes:
> I'm looking at this as I'd like to use the keepalive functionality.
>
> * gnu/services/web.scm (nginx-upstream-configuration-extra-content): New
> procedure.
> (emit-nginx-upstream-config): Include the extra-content if applicable.
> * doc/guix.texi (NGINX): Document this.
> ---
> doc/guix.texi | 3 +++
> gnu/services/web.scm | 14 +++++++++++++-
> 2 files changed, 16 insertions(+), 1 deletion(-)
I've gone ahead and pushed this as
b5c6062bcec9530a9c4044a1bd1091fdebf9bc74.
[signature.asc (application/pgp-signature, inline)]
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 29 Jul 2022 11:24:10 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 264 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.