2023-04-05 21:10:58 -07:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2023-04-07 16:50:38 -07:00
|
|
|
imports = [
|
|
|
|
(import ./acme.nix)
|
|
|
|
];
|
2023-04-05 21:10:58 -07:00
|
|
|
|
|
|
|
services.nginx = {
|
2023-04-07 16:50:38 -07:00
|
|
|
enable = true;
|
2023-04-05 21:10:58 -07:00
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
|
2023-04-07 16:50:38 -07:00
|
|
|
virtualHosts = {
|
|
|
|
"nickiel.net" = {
|
|
|
|
locations."/" = {
|
|
|
|
root = "/var/lib/acme/nickiel.net";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"files.nickiel.net" = {
|
|
|
|
#forceSSL = true;
|
|
|
|
#enableACME = true;
|
|
|
|
locations."/.well-known/acme-challenge" = {
|
|
|
|
root = "/var/lib/acme/.challenges";
|
|
|
|
};
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://192.168.100.11:80";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
"acmechallenge.nickiel.net" = {
|
|
|
|
# Catchall vhost, will redirect users to HTTPS for all vhosts
|
|
|
|
serverAliases = [ "*.nickiel.net" ];
|
|
|
|
locations."/.well-known/acme-challenge" = {
|
|
|
|
root = "/var/lib/acme/.challenges";
|
|
|
|
};
|
|
|
|
locations."/" = {
|
|
|
|
return = "301 https://$host$request_uri";
|
|
|
|
};
|
|
|
|
};
|
2023-04-05 21:10:58 -07:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|