Skip to content

fix: add Caddy proxy to InvenTree for static file serving - #88

Merged
cori merged 1 commit into
mainfrom
fix/inventree-caddy-proxy
Sep 20, 2026
Merged

cori merged 1 commit into
mainfrom
fix/inventree-caddy-proxy

Conversation

@cori

@cori cori commented Sep 20, 2026

Copy link
Copy Markdown
Owner

Problem

InvenTree's Django server does not serve static files in production mode. Without a file server (Caddy/nginx), the SPA shell loads but JS/CSS assets return 302 redirects to Django, which can't serve them — resulting in the INVE-E1 error page.

Fix

  • Add inventree-proxy service (caddy:alpine) as isMain on port 80
  • Caddy serves /static/ and /media/ from the shared data volume
  • Caddy proxies all other requests to inventree-server:8000
  • Move isMain/internalPort off the server (now internal-only)
  • Include Caddyfile in data/ directory
  • Bump tipi_version to 2, port to 80

Test plan

  • bun test passes (126/126)
  • Browser verification: login page renders with username/password form
  • JS assets load from /static/ (no more 302 redirects)
  • API auth works: curl -u admin:*** /api/user/me/ returns admin user
  • Version 1.5.5 displayed in UI footer

InvenTree's Django server does not serve static files in production
mode — it requires a separate file server (Caddy/nginx) for /static/
and /media/. Without it, the SPA shell loads but JS assets 302 redirect
to the Django server which can't serve them, causing INVE-E1 error.

Changes:
- Add inventree-proxy service (caddy:alpine) as isMain on port 80
- Move isMain/internalPort off inventree-server (now internal-only)
- Caddy proxies API requests to inventree-server:8000
- Caddy serves /static/ and /media/ from the shared data volume
- Include Caddyfile in data/ directory
- Bump tipi_version to 2, port to 80

Verified: login page renders correctly, JS assets load, API auth works.
@cori
cori merged commit 226b285 into main Sep 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants