diff options
| author | Arun Isaac | 2025-11-09 11:51:37 +0000 |
|---|---|---|
| committer | Arun Isaac | 2025-11-09 11:51:37 +0000 |
| commit | 4fb5ad671312091e10eff831600dab1b5cd4a6dd (patch) | |
| tree | a372ce0b3c146e46f27b7bc3f485638098b47ff9 /guix/forge/nginx.scm | |
| parent | b892157fe3a8dd904d518630b7df6ff2e8a1f4f9 (diff) | |
| download | guix-forge-4fb5ad671312091e10eff831600dab1b5cd4a6dd.tar.gz guix-forge-4fb5ad671312091e10eff831600dab1b5cd4a6dd.tar.lz guix-forge-4fb5ad671312091e10eff831600dab1b5cd4a6dd.zip | |
nginx: Move socket->proxy-pass to (forge nginx).
Diffstat (limited to 'guix/forge/nginx.scm')
| -rw-r--r-- | guix/forge/nginx.scm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/guix/forge/nginx.scm b/guix/forge/nginx.scm index c932187..2e22bd8 100644 --- a/guix/forge/nginx.scm +++ b/guix/forge/nginx.scm @@ -36,6 +36,7 @@ forge-nginx-configuration-acme-challenge-directory forge-nginx-configuration-server-blocks nginx-socket->string + socket->nginx-proxy-pass forge-nginx-service-type)) (define-record-type* <forge-nginx-configuration> @@ -72,6 +73,22 @@ configuration (for example, in the @code{listen} and (($ <forge-unix-socket> path) (string-append "unix:" path)))) +(define (socket->nginx-proxy-pass socket) + "Serialize @var{socket}, a forge socket, to an nginx @code{proxy_pass} +directive." + (string-append + "proxy_pass " + (match socket + (($ <forge-host-socket> hostname port) + (string-append "http://" hostname ":" (number->string port))) + (($ <forge-ip-socket> (? ipv4-address? ip) port) + (string-append "http://" ip ":" (number->string port))) + (($ <forge-ip-socket> (? ipv6-address? ip) port) + (string-append "http://[" ip "]:" (number->string port))) + (($ <forge-unix-socket> path) + (string-append "http://unix:" path ":"))) + ";")) + (define (forge-nginx-server-blocks config) "Return list of nginx server blocks to provision for forge-web service specified by @var{config}." |
