Skip to content

Instantly share code, notes, and snippets.

@ramirez7
Created February 24, 2023 21:04
Show Gist options
  • Select an option

  • Save ramirez7/ca9729110eb7b40c6443b59e3057dee1 to your computer and use it in GitHub Desktop.

Select an option

Save ramirez7/ca9729110eb7b40c6443b59e3057dee1 to your computer and use it in GitHub Desktop.
{
services.paperless = {
enable = true;
consumptionDirIsPublic = true;
extraConfig = {
PAPERLESS_CSRF_TRUSTED_ORIGINS="http://localhost,http://armando-desktop.local";
PAPERLESS_ALLOWED_HOSTS="localhost,armando-desktop.local";
PAPERLESS_CORS_ALLOWED_HOSTS="http://localhost,http://armando-desktop.local";
};
};
networking.firewall.allowedTCPPorts = [ 80 ];
services.nginx = {
enable = true;
virtualHosts."armando-desktop.local" = {
locations."/" = {
proxyPass = "http://localhost:28981/";
# Per https://paperless-ngx.readthedocs.io/en/beta/setup.html#using-nginx-as-a-reverse-proxy
extraConfig = ''
# These configuration options are required for WebSockets to work.
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
'';
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment