nginx proxy function

This commit is contained in:
Noa Aarts 2024-06-04 21:23:35 +02:00
parent b5f91441c8
commit 8bb45dd4a6

View file

@ -232,7 +232,8 @@
sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL"; sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
virtualHosts = virtualHosts =
let extra = '' let
extra = ''
client_max_body_size 50000M; client_max_body_size 50000M;
proxy_set_header Host $host; proxy_set_header Host $host;
@ -248,46 +249,28 @@
proxy_read_timeout 600s; proxy_read_timeout 600s;
proxy_send_timeout 600s; proxy_send_timeout 600s;
send_timeout 600s;''; send_timeout 600s;'';
proxy = port: {
forceSSl = true;
useACMEHost = "noa.voorwaarts.nl";
extraConfig = extra;
locations."/" = {
proxyPass = "http://127.0.0.1:${builtins.toString port}/";
};
};
in in
{ {
"noa.voorwaarts.nl" = { "noa.voorwaarts.nl" = {
default = true; default = true;
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
};
"images.noa.voorwaarts.nl" = {
forceSSL = true;
useACMEHost = "noa.voorwaarts.nl";
extraConfig = extra;
locations."/" = {
proxyPass = "http://127.0.0.1:2283/";
};
};
"testing.noa.voorwaarts.nl" = {
forceSSL = true;
useACMEHost = "noa.voorwaarts.nl";
extraConfig = extra;
locations."/" = {
proxyPass = "http://127.0.0.1:8000/";
};
};
"sods.noa.voorwaarts.nl" = {
forceSSL = true;
useACMEHost = "noa.voorwaarts.nl";
extraConfig = extra;
locations."/" = {
proxyPass = "http://127.0.0.1:2000/";
};
}; };
"images.noa.voorwaarts.nl" = proxy 2283;
"testing.noa.voorwaarts.nl" = proxy 8000;
"sods.noa.voorwaarts.nl" = proxy 2000;
}; };
}; };
openssh = { openssh = {
enable = true; enable = true;
settings.PasswordAuthentication = false; settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false; settings.KbdInteractiveAuthentication = false;
}; };