From 45343b1e14a3fd2f581465d3e78adac372918a0c Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 1 Feb 2016 16:03:03 +0100 Subject: l 3 *_nginx: allow configuration of ssl --- lass/3modules/wordpress_nginx.nix | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'lass/3modules/wordpress_nginx.nix') diff --git a/lass/3modules/wordpress_nginx.nix b/lass/3modules/wordpress_nginx.nix index 974aacd83..bfed9e7c6 100644 --- a/lass/3modules/wordpress_nginx.nix +++ b/lass/3modules/wordpress_nginx.nix @@ -53,6 +53,23 @@ let "1" = "test.testsite.de"; }; }; + ssl = mkOption { + type = with types; submodule ({ + options = { + enable = mkEnableOption "ssl"; + certificate = mkOption { + type = str; + }; + certificate_key = mkOption { + type = str; + }; + ciphers = mkOption { + type = str; + default = "AES128+EECDH:AES128+EDH"; + }; + }; + }); + }; }; })); default = {}; @@ -68,7 +85,7 @@ let # } #''; - krebs.nginx.servers = flip mapAttrs cfg ( name: { domain, folder, multiSite, ... }: { + krebs.nginx.servers = flip mapAttrs cfg ( name: { domain, folder, multiSite, ssl, ... }: { server-names = [ "${domain}" "www.${domain}" @@ -114,7 +131,17 @@ let error_log /tmp/nginx_err.log; error_page 404 /404.html; error_page 500 502 503 504 /50x.html; + ${if ssl.enable then '' + ssl_certificate ${ssl.certificate}; + ssl_certificate_key ${ssl.certificate_key}; + '' else ""} + ''; + listen = (if ssl.enable then + [ "80" "443 ssl" ] + else + "80" + ); }); services.phpfpm.poolConfigs = flip mapAttrs cfg (name: { domain, folder, ... }: '' listen = ${folder}/phpfpm.pool -- cgit v1.2.3