os/modules/paperless/nginx.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
517 B
Nix
Raw Normal View History

2023-10-28 23:23:14 +00:00
{ config, ... }:
let
cfg = config.pub-solar.paperless;
nginxLocation = if cfg.path == "" then "/" else cfg.path;
in
{
services.nginx = {
enable = true;
virtualHosts."${cfg.domain}" = {
locations."${nginxLocation}" = {
proxyPass = "http://127.0.0.1:8899";
proxyWebsockets = true;
extraConfig = ''
proxy_read_timeout 300s;
proxy_set_header Host ${cfg.domain};
proxy_set_header X-Forwarded-For ''$remote_addr;
'';
};
};
};
}