All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m16s
81 lines
2.0 KiB
Nix
81 lines
2.0 KiB
Nix
{
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
{
|
|
services.nginx =
|
|
let
|
|
proxyConfig = ''
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
'';
|
|
in
|
|
{
|
|
enable = true;
|
|
package = pkgs.openresty;
|
|
recommendedGzipSettings = true;
|
|
recommendedOptimisation = true;
|
|
recommendedTlsSettings = true;
|
|
clientMaxBodySize = "2G";
|
|
virtualHosts = {
|
|
"library.mesh.vimium.net" = {
|
|
locations."/" = {
|
|
root = "/mnt/library";
|
|
extraConfig = ''
|
|
autoindex on;
|
|
'';
|
|
};
|
|
};
|
|
"chat.ai.vimium.com" = {
|
|
listen = [
|
|
{
|
|
addr = "127.0.0.1";
|
|
port = 8001;
|
|
}
|
|
];
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:8081";
|
|
extraConfig =
|
|
proxyConfig
|
|
+ ''
|
|
# Disable proxy buffering for better streaming response from models
|
|
proxy_buffering off;
|
|
|
|
# Increase max request size for large attachments and long audio messages
|
|
client_max_body_size 20M;
|
|
proxy_read_timeout 10m;
|
|
'';
|
|
};
|
|
};
|
|
"jellyfin.vimium.com" = {
|
|
default = true;
|
|
listen = [
|
|
{
|
|
addr = "127.0.0.1";
|
|
port = 8000;
|
|
}
|
|
];
|
|
locations."/" = {
|
|
proxyPass = "http://localhost:8096";
|
|
extraConfig =
|
|
proxyConfig
|
|
+ ''
|
|
proxy_set_header Range $http_range;
|
|
proxy_set_header If-Range $http_if_range;
|
|
'';
|
|
};
|
|
locations."/metrics" = {
|
|
return = "404";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|