diff options
Diffstat (limited to 'tw/services/web.scm')
-rw-r--r-- | tw/services/web.scm | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tw/services/web.scm b/tw/services/web.scm index 12851a72..8e8e0ebe 100644 --- a/tw/services/web.scm +++ b/tw/services/web.scm @@ -6,9 +6,14 @@ #:use-module (guix gexp) #:use-module (guix records) #:use-module ((srfi srfi-1) #:select (concatenate)) - #:export (https-reverse-proxy-service-type + #:export (%nginx-cert-deploy-hook + https-reverse-proxy-service-type https-reverse-proxy-configuration)) +(define %nginx-cert-deploy-hook + (program-file "nginx-cert-deploy-hook" + #~(kill (call-with-input-file "/var/run/nginx/pid" read) SIGHUP))) + (define-configuration/no-serialization https-reverse-proxy-configuration (domains list-of-strings "List of domain names that nginx should proxy requests for.") @@ -17,18 +22,13 @@ proxied to.") (destination-ip (string "127.0.0.1") "The IP address of the server that should be proxied to. Usually, this should be localhost.") (destination-protocol (string "http") "The protocol that the proxied service -speaks. Set to @code{\"https\"} if you want to proxy HTTPS-to-HTTPS.") - (nginx-pid-file (string "/var/run/nginx/pid") "The file containing nginx's -process ID. This may differ from the default if nginx's @code{run-directory} -differs from its default.")) +speaks. Set to @code{\"https\"} if you want to proxy HTTPS-to-HTTPS.")) (define (reverse-proxy-certificate config) - (match-record config <https-reverse-proxy-configuration> (domains nginx-pid-file) + (match-record config <https-reverse-proxy-configuration> (domains) (certificate-configuration (domains domains) - (deploy-hook - (program-file "nginx-cert-deploy-hook" - #~(kill (call-with-input-file #$nginx-pid-file read) SIGHUP)))))) + (deploy-hook %nginx-cert-deploy-hook)))) (define (reverse-proxy-nginx-server config) (match-record config <https-reverse-proxy-configuration> |