mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 04:59:23 +08:00
fix nginx
This commit is contained in:
6
flake.lock
generated
6
flake.lock
generated
@@ -627,11 +627,11 @@
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1692980874,
|
||||
"narHash": "sha256-KA6MGgPk5Zol96BTjVBV9bYPj/POotyHgoOKtctiJj4=",
|
||||
"lastModified": 1692982424,
|
||||
"narHash": "sha256-H0gz5N3k1rNu5EUxiZ6wcQ0Dxlaw1tbQGtMlXgPH30Q=",
|
||||
"owner": "CHN-beta",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "127bcf01ca05fdaf55b644f3b274dfaedd9a2aa6",
|
||||
"rev": "ef4323e25b0991d997ae8f78e2a428b5cc98667c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -979,7 +979,15 @@ inputs:
|
||||
{
|
||||
services =
|
||||
{
|
||||
nginx = { enable = true; httpProxy."wallabag.chn.moe".upstream = "http://127.0.0.1:4398"; };
|
||||
nginx =
|
||||
{
|
||||
enable = true;
|
||||
httpProxy."wallabag.chn.moe" =
|
||||
{
|
||||
upstream = "http://127.0.0.1:4398";
|
||||
setHeaders.Host = "wallabag.chn.moe";
|
||||
};
|
||||
};
|
||||
postgresql.enable = true;
|
||||
};
|
||||
virtualization.docker.enable = true;
|
||||
|
||||
@@ -106,12 +106,17 @@ inputs:
|
||||
enable = true;
|
||||
httpProxy =
|
||||
{
|
||||
"${misskey.hostname}" = { upstream = "http://127.0.0.1:${toString misskey.port}"; websocket = true; };
|
||||
"${misskey.hostname}" =
|
||||
{
|
||||
upstream = "http://127.0.0.1:${toString misskey.port}";
|
||||
websocket = true;
|
||||
setHeaders.Host = misskey.hostname;
|
||||
};
|
||||
"direct.${misskey.hostname}" =
|
||||
{
|
||||
upstream = "http://127.0.0.1:${toString misskey.port}";
|
||||
websocket = true;
|
||||
setHeaders.Host = "${misskey.hostname}";
|
||||
setHeaders.Host = misskey.hostname;
|
||||
detectAuth = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -67,6 +67,12 @@ inputs:
|
||||
{
|
||||
proxyPass = site.value.upstream;
|
||||
proxyWebsockets = site.value.websocket;
|
||||
recommendedProxySettings = false;
|
||||
recommendedProxySettingsNoHost = true;
|
||||
basicAuthFile =
|
||||
if site.value.detectAuth then
|
||||
inputs.config.sops.secrets."nginx/detectAuth/${site.name}".path
|
||||
else null;
|
||||
extraConfig = concatStringsSep "\n"
|
||||
(
|
||||
(map
|
||||
@@ -78,15 +84,7 @@ inputs:
|
||||
["include ${inputs.config.sops.templates."nginx/addAuth/${site.name}-template".path};"]
|
||||
else [])
|
||||
);
|
||||
}
|
||||
// (
|
||||
if site.value.detectAuth then
|
||||
{
|
||||
recommendedProxySettings = false;
|
||||
basicAuthFile = inputs.config.sops.secrets."nginx/detectAuth/${site.name}".path;
|
||||
}
|
||||
else {}
|
||||
);
|
||||
};
|
||||
addSSL = true;
|
||||
forceSSL = site.value.rewriteHttps;
|
||||
http2 = site.value.http2;
|
||||
|
||||
@@ -57,7 +57,15 @@ inputs:
|
||||
nixos.services =
|
||||
{
|
||||
redis.instances.rsshub.port = 7116;
|
||||
nginx = { enable = true; httpProxy.${rsshub.hostname}.upstream = "http://127.0.0.1:${toString rsshub.port}"; };
|
||||
nginx =
|
||||
{
|
||||
enable = true;
|
||||
httpProxy.${rsshub.hostname} =
|
||||
{
|
||||
upstream = "http://127.0.0.1:${toString rsshub.port}";
|
||||
setHeaders.Host = rsshub.hostname;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user