mirror of
https://github.com/Nickiel12/nicks-nix-config.git
synced 2024-11-26 14:45:29 -08:00
46 lines
1.1 KiB
Nix
46 lines
1.1 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
(import ./acme.nix)
|
|
];
|
|
|
|
services.nginx = {
|
|
enable = true;
|
|
recommendedGzipSettings = true;
|
|
recommendedOptimisation = true;
|
|
recommendedProxySettings = true;
|
|
recommendedTlsSettings = true;
|
|
|
|
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";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|