Move Nginx virtual hosts to relative modules
This commit is contained in:
parent
5fa324bfa2
commit
908508743b
3 changed files with 27 additions and 102 deletions
|
@ -163,6 +163,19 @@ in
|
||||||
config.services.home-assistant.configDir
|
config.services.home-assistant.configDir
|
||||||
];
|
];
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."home.aciceri.dev" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString config.services.home-assistant.config.http.server_port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# virtualisation.oci-containers = {
|
# virtualisation.oci-containers = {
|
||||||
# backend = "podman";
|
# backend = "podman";
|
||||||
# containers.homeassistant = {
|
# containers.homeassistant = {
|
||||||
|
|
|
@ -22,4 +22,16 @@
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
options = [ "bind" ];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."photos.aciceri.dev" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString config.services.immich.port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
extraConfig = ''
|
||||||
|
client_max_body_size 50000M;
|
||||||
|
'';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,105 +1,5 @@
|
||||||
{ config, ... }:
|
|
||||||
{
|
{
|
||||||
imports = [ ../nginx-base ];
|
imports = [ ../nginx-base ];
|
||||||
services.nginx.virtualHosts = {
|
# TODO this file can be probably deleted now
|
||||||
localhost.listen = [ { addr = "127.0.0.1"; } ];
|
# each module defining a virtualHost should import nginx-base
|
||||||
"home.aciceri.dev" = {
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:${builtins.toString config.services.home-assistant.config.http.server_port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection $connection_upgrade;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"home.sisko.aciceri.dev" = {
|
|
||||||
forceSSL = true;
|
|
||||||
useACMEHost = "aciceri.dev";
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:${builtins.toString config.services.home-assistant.config.http.server_port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
extraConfig = ''
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection $connection_upgrade;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"photos.aciceri.dev" = {
|
|
||||||
extraConfig = ''
|
|
||||||
client_max_body_size 50000M;
|
|
||||||
'';
|
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
locations."/" = {
|
|
||||||
proxyPass = "http://localhost:${builtins.toString config.services.immich.port}";
|
|
||||||
proxyWebsockets = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# "${config.services.nextcloud.hostName}" = {
|
|
||||||
# forceSSL = true;
|
|
||||||
# enableACME = true;
|
|
||||||
# };
|
|
||||||
# "sevenofnix.aciceri.dev" = {
|
|
||||||
# forceSSL = true;
|
|
||||||
# enableACME = true;
|
|
||||||
# locations."/" = {
|
|
||||||
# proxyPass = "http://10.1.1.2:${builtins.toString config.services.buildbot-master.port}";
|
|
||||||
# proxyWebsockets = true;
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
|
|
||||||
# services.oauth2_proxy = {
|
|
||||||
# enable = true;
|
|
||||||
# provider = "oidc";
|
|
||||||
# reverseProxy = true;
|
|
||||||
# # replaces following options with .keyFile
|
|
||||||
|
|
||||||
# clientID = "shouldThisBePrivate?";
|
|
||||||
# clientSecret = "thisShouldBePrivate";
|
|
||||||
# cookie.secret = "thisShouldBePrivate00000";
|
|
||||||
|
|
||||||
# email.domains = [ "*" ];
|
|
||||||
# extraConfig = {
|
|
||||||
# # custom-sign-in-logo = "${../../lib/mlabs-logo.svg}";
|
|
||||||
# # scope = "user:email";
|
|
||||||
# # banner = "MLabs Status";
|
|
||||||
# # whitelist-domain = ".status.staging.mlabs.city";
|
|
||||||
# oidc-issuer-url = "http://127.0.0.1:5556/dex";
|
|
||||||
# };
|
|
||||||
# # redirectURL = "https://status.staging.mlabs.city/oauth2/callback";
|
|
||||||
# # keyFile = config.age.secrets.status-oauth2-secrets.path;
|
|
||||||
# # cookie.domain = ".status.staging.mlabs.city";
|
|
||||||
# nginx = {
|
|
||||||
# virtualHosts = [
|
|
||||||
# "search.aciceri.dev"
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
|
|
||||||
# services.dex = {
|
|
||||||
# enable = true;
|
|
||||||
# settings = {
|
|
||||||
# issuer = "http://127.0.0.1:5556/dex";
|
|
||||||
# storage = {
|
|
||||||
# type = "postgres";
|
|
||||||
# config.host = "/var/run/postgresql";
|
|
||||||
# };
|
|
||||||
# web = {
|
|
||||||
# http = "127.0.0.1:5556";
|
|
||||||
# };
|
|
||||||
# enablePasswordDB = true;
|
|
||||||
# staticClients = [
|
|
||||||
# {
|
|
||||||
# # id = "oidcclient";
|
|
||||||
# # name = "client";
|
|
||||||
# # redirecturis = [ "https://login.aciceri.dev/callback" ];
|
|
||||||
# # secretfile = "/etc/dex/oidcclient"; # the content of `secretfile` will be written into to the config as `secret`.
|
|
||||||
# }
|
|
||||||
# ];
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue