Open-source personal finance manager. Self-hosted, privacy-first.
server {
listen 8080;
root /usr/share/nginx/html;
index index.html;
# Attachments go up to STORAGE_MAX_FILE_SIZE_MB (10 MB); nginx's default limit is 1 MB.
client_max_body_size 15m;
# API proxy to backend.
# Resolve the backend hostname at request time via Docker's embedded DNS
# instead of caching the IP at startup. Without this, Nginx pins the
# upstream IP when the config loads and returns 502s after the backend
# container is recreated with a new IP (e.g. selective redeploys where the
# frontend container is left running). Using a variable in proxy_pass forces
# re-resolution. NGINX_RESOLVER is derived from the platform's own
# /etc/resolv.conf at startup (see docker-entrypoint.d/19-resolver.envsh),
# so this works as-is on Docker, Podman, Kubernetes and Railway. Set
# NGINX_RESOLVER explicitly to override that detection.
location /api/ {
resolver ${NGINX_RESOLVER} valid=5s;
set $upstream ${BACKEND_URL};
proxy_pass $upstream;
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-Proto $scheme;
}
# Connecting a bank imports its whole history in this one request; a
# SimpleFIN link with several institutions can take well over nginx's
# default 60s read timeout, which turned a working import into a 504
# "Failed to connect bank" (issue #1148).
location = /api/connections/oauth/callback {
resolver ${NGINX_RESOLVER} valid=5s;
set $upstream ${BACKEND_URL};
proxy_pass $upstream;
proxy_read_timeout 300s;
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-Proto $scheme;
}
# Never cache index.html so new deployments are always picked up immediately
location = /index.html {
add_header Cache-Control "no-store, no-cache, must-revalidate";
try_files $uri =404;
}
# SPA fallback — serve index.html for all non-file routes
location / {
try_files $uri $uri/ /index.html;
}
}