Move nginx to https
This commit is contained in:
parent
db427c28ea
commit
ac483e1d9d
6 changed files with 106 additions and 5 deletions
|
@ -485,5 +485,8 @@ in
|
|||
EDITOR = "kak";
|
||||
VISUAL = "kak";
|
||||
};
|
||||
|
||||
# Trust my own cert
|
||||
security.pki.certificateFiles = [ ../../../nki-home/cert.pem ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -41,11 +41,19 @@ in
|
|||
type = types.path;
|
||||
description = "Path to the private key .pem file";
|
||||
};
|
||||
sslCertificate = mkOption {
|
||||
type = types.path;
|
||||
description = "Path to the private key .pem file";
|
||||
};
|
||||
sslCertificateKey = mkOption {
|
||||
type = types.path;
|
||||
description = "Path to the private key .pem file";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
nix.settings = mkIf cfg.enableClient {
|
||||
substituters = lib.mkAfter [ "http://${cfg.host}" ];
|
||||
substituters = lib.mkAfter [ "https://${cfg.host}" ];
|
||||
trusted-public-keys = [ cfg.publicKey ];
|
||||
};
|
||||
|
||||
|
@ -64,6 +72,9 @@ in
|
|||
virtualHosts = {
|
||||
# ... existing hosts config etc. ...
|
||||
"${cfg.host}" = {
|
||||
forceSSL = true;
|
||||
sslCertificate = cfg.sslCertificate;
|
||||
sslCertificateKey = cfg.sslCertificateKey;
|
||||
locations."/".proxyPass = "http://${bindAddr}";
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue