ingress-proxy: refactor vhosts
This commit is contained in:
parent
03ee2a92fd
commit
34be84f64f
1 changed files with 16 additions and 25 deletions
|
@ -24,24 +24,28 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualHosts = let
|
virtualHosts = let
|
||||||
static = { src ? null, url ? null, rev ? null, aliases ? [] }: {
|
defaultConfig = {
|
||||||
http2 = true;
|
http2 = true;
|
||||||
http3 = true;
|
http3 = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
|
};
|
||||||
|
static = { src ? null, url ? null, rev ? null, aliases ? [] }: {
|
||||||
serverAliases = aliases;
|
serverAliases = aliases;
|
||||||
|
|
||||||
root = if src != null then src else builtins.fetchGit { inherit url rev; };
|
root = if src != null then src else builtins.fetchGit { inherit url rev; };
|
||||||
};
|
} // defaultConfig;
|
||||||
|
placeholder = {
|
||||||
|
locations."/" = {
|
||||||
|
alias = pkgs.writeText "placeholder.html" "<!doctype html><h1>empty space</h1><p>this site is not operational</p>";
|
||||||
|
extraConfig = ''
|
||||||
|
default_type text/html;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
} // defaultConfig;
|
||||||
in {
|
in {
|
||||||
# Matrix (main)
|
# Matrix (main)
|
||||||
"mx.sapphic.engineer" = {
|
"mx.sapphic.engineer" = defaultConfig // {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
http2 = true;
|
|
||||||
http3 = true;
|
|
||||||
|
|
||||||
listen = [
|
listen = [
|
||||||
{ addr = "0.0.0.0"; port = 443; ssl = true; }
|
{ addr = "0.0.0.0"; port = 443; ssl = true; }
|
||||||
{ addr = "[::]"; port = 443; ssl = true; }
|
{ addr = "[::]"; port = 443; ssl = true; }
|
||||||
|
@ -64,12 +68,7 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
"happ.ystatic.buzz" = {
|
"happ.ystatic.buzz" = defaultConfig // {
|
||||||
forceSSL = true;
|
|
||||||
enableACME = true;
|
|
||||||
http2 = true;
|
|
||||||
http3 = true;
|
|
||||||
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://hsb";
|
proxyPass = "http://hsb";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
|
@ -89,18 +88,10 @@ in {
|
||||||
rev = "8601d3a426bc07c715f265b2132b384c21397533";
|
rev = "8601d3a426bc07c715f265b2132b384c21397533";
|
||||||
};
|
};
|
||||||
|
|
||||||
"oc.mekanoe.com" = static {
|
"oc.mekanoe.com" = placeholder;
|
||||||
src = pkgs.writeText "oc.mekanoe.com" "down";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Generic store for /.well-known/ paths.
|
# Generic store for /.well-known/ paths.
|
||||||
"well-known.sapphic.engineer" = {
|
"well-known.sapphic.engineer" = defaultConfig // {
|
||||||
#serverAliases = [ "sapphic.engineer" ];
|
|
||||||
forceSSL = false;
|
|
||||||
enableACME = true;
|
|
||||||
http2 = true;
|
|
||||||
http3 = true;
|
|
||||||
|
|
||||||
locations."=/.well-known/matrix/server" = let
|
locations."=/.well-known/matrix/server" = let
|
||||||
alias = pkgs.writeText "well-known-matrix-server" (builtins.toJSON {
|
alias = pkgs.writeText "well-known-matrix-server" (builtins.toJSON {
|
||||||
"m.server" = "mx.sapphic.engineer";
|
"m.server" = "mx.sapphic.engineer";
|
||||||
|
|
Loading…
Add table
Reference in a new issue