* [bug#71673] [PATCH] services: nginx: Print extra-content before the server-blocks.
@ 2024-06-20 11:14 Tomas Volf
2024-10-06 15:40 ` [bug#71673] [PATCH v2] " Tomas Volf
0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2024-06-20 11:14 UTC (permalink / raw)
To: 71673; +Cc: Tomas Volf
The configuration file is processed sequentially, which meant that there was
no way to set for example log format shared between the server-blocks, because
the final configuration file would have this order:
...
http {
...
server {
}
...
$extra-content
}
Moving the extra-content before the serialization of server-blocks resolves
this.
* gnu/services/web.scm (default-nginx-config): Move extra-content before
server-blocks.
Change-Id: Ie8286a533dfed575abc58a0f4800706b3ad6adc2
---
While this I assume *could* be considered a backwards incompatible change, I
cannot really think of anything that it would break.
gnu/services/web.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 406117c457..e3887d0ed8 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -768,11 +768,11 @@ (define (default-nginx-config config)
(number->string server-names-hash-bucket-max-size)
";\n")
"")
+ extra-content
"\n"
(map emit-nginx-upstream-config upstream-blocks)
(map emit-nginx-server-config server-blocks)
- extra-content
- "\n}\n"))))
+ "}\n"))))
(define %nginx-accounts
(list (user-group (name "nginx") (system? #t))
--
2.45.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [bug#71673] [PATCH v2] services: nginx: Print extra-content before the server-blocks.
2024-06-20 11:14 [bug#71673] [PATCH] services: nginx: Print extra-content before the server-blocks Tomas Volf
@ 2024-10-06 15:40 ` Tomas Volf
2024-11-20 22:39 ` bug#71673: " Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2024-10-06 15:40 UTC (permalink / raw)
To: 71673; +Cc: Tomas Volf
The configuration file is processed sequentially, which meant that there was
no way to set for example log format shared between the server-blocks, because
the final configuration file would have this order:
...
http {
...
server {
}
...
$extra-content
}
Moving the extra-content before the serialization of server-blocks resolves
this.
* gnu/services/web.scm (default-nginx-config): Move extra-content before
server-blocks.
Change-Id: Ie8286a533dfed575abc58a0f4800706b3ad6adc2
---
Rebase on latest master.
gnu/services/web.scm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index cc6f4e6d9b..84ce88aa80 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -770,10 +770,7 @@ (define (default-nginx-config config)
(number->string server-names-hash-bucket-max-size)
";\n")
"")
- "\n"
- (map emit-nginx-upstream-config upstream-blocks)
- (map emit-nginx-server-config server-blocks)
- (match extra-content
+ (match extra-content
((? list? extra-content)
(map (lambda (line)
`(" " ,line "\n"))
@@ -781,7 +778,10 @@ (define (default-nginx-config config)
;; XXX: For compatibility strings and gexp's are inserted
;; directly.
(_ extra-content))
- "\n}\n"))))
+ "\n"
+ (map emit-nginx-upstream-config upstream-blocks)
+ (map emit-nginx-server-config server-blocks)
+ "}\n"))))
(define %nginx-accounts
(list (user-group (name "nginx") (system? #t))
--
2.46.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#71673: [PATCH v2] services: nginx: Print extra-content before the server-blocks.
2024-10-06 15:40 ` [bug#71673] [PATCH v2] " Tomas Volf
@ 2024-11-20 22:39 ` Ludovic Courtès
0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2024-11-20 22:39 UTC (permalink / raw)
To: Tomas Volf; +Cc: 71673-done
Tomas Volf <~@wolfsden.cz> skribis:
> The configuration file is processed sequentially, which meant that there was
> no way to set for example log format shared between the server-blocks, because
> the final configuration file would have this order:
>
> ...
> http {
> ...
> server {
> }
> ...
> $extra-content
> }
>
> Moving the extra-content before the serialization of server-blocks resolves
> this.
>
> * gnu/services/web.scm (default-nginx-config): Move extra-content before
> server-blocks.
>
> Change-Id: Ie8286a533dfed575abc58a0f4800706b3ad6adc2
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-11-20 22:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20 11:14 [bug#71673] [PATCH] services: nginx: Print extra-content before the server-blocks Tomas Volf
2024-10-06 15:40 ` [bug#71673] [PATCH v2] " Tomas Volf
2024-11-20 22:39 ` bug#71673: " Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.