hosts/remilia: random nginx changes

Signed-off-by: natto1784 <natto@weirdnatto.in>
This commit is contained in:
2023-04-27 15:01:33 +05:30
parent 0e4ac5dfe5
commit be59cc0e8a
3 changed files with 21 additions and 13 deletions

View File

@@ -17,8 +17,8 @@
let
t = lib.splitString ":" x.destination;
in
with builtins;
"iptables -t nat -A POSTROUTING -d ${head t} -p tcp -m tcp --dport ${head (tail t)} -j MASQUERADE"
with lib;
"iptables -t nat -A POSTROUTING -d ${head t} -p tcp -m tcp --dport ${last t} -j MASQUERADE"
)
config.networking.nat.forwardPorts;
};

View File

@@ -4,6 +4,7 @@ let
in
{
services = {
cron.enable = true;
openssh = {
enable = true;
permitRootLogin = "yes";
@@ -23,14 +24,15 @@ in
appendHttpConfig = ''
map $uri $expires {
default off;
~\.(jpg|jpeg|png|gif|ico|css|js)$ 30d;
~\.(jpg|jpeg|png|gif|ico)$ 30d;
}
'';
virtualHosts =
let
genericHttpRProxy = { addr, ssl ? true, conf ? "" }: {
addSSL = ssl;
enableACME = ssl;
# addSSL = ssl;
forceSSL = ssl;
locations."/" = {
proxyPass = toString addr;
extraConfig = ''
@@ -54,7 +56,20 @@ in
"vault.${domain}" = genericHttpRProxy { addr = "https://${marisa}:8800"; };
"consul.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8500"; };
"f.${domain}" = genericHttpRProxy { addr = "http://${marisa}:8888"; };
"radio.${domain}" = genericHttpRProxy { addr = "http://${satori}:8001"; };
# "radio.${domain}" = genericHttpRProxy { addr = "http://${satori}:8001"; };
"radio.${domain}" = {
addSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://${satori}:7590";
extraConfig = ''
expires $expires;
proxy_set_header Host $host;
'';
};
locations."= /".return = "301 /radio";
};
"git.${domain}" = genericHttpRProxy {
addr = "http://${marisa}:5000";
conf = "client_max_body_size 64M;";
@@ -66,13 +81,6 @@ in
proxy_read_timeout 310s;
'';
};
"alo.${domain}" = genericHttpRProxy {
addr = "http://${marisa}:4004";
conf = ''
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
'';
};
};
};
};