[Feature] Support serving Immich under a sub-path (e.g. /immich) via reverse proxy #23688
Closed
VrushankPatel
started this conversation in
Feature Request
Replies: 1 comment
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I have searched the existing feature requests, both open and closed, to make sure this is not a duplicate request.
The feature
Title:
Support for serving Immich under a sub-path (e.g.
https://domain.com/immich) via reverse proxyUse case:
I run multiple self-hosted services behind a single Nginx reverse proxy. For example:
https://domain.com/portainer→ service at port 9000https://domain.com/immich→ Immich backend at port 2283This is convenient because I don’t want to allocate a separate sub-domain for Immich. I already have
domain.comin use and other services under paths.Problem:
When I attempt to proxy Immich via Nginx using
location /immich { … } proxy_pass http://internal:2283; }, I encounter issues:/)./immich/....BASE_URLorSUB_PATHenvironment variable in Immich’s docs or.envthat allows this path prefixing.How we expect it to be:
Immich should support being served under a path prefix (e.g.
/immich) without breaking UI, API or socket connections.There should be a documented environment variable (for example
BASE_PATH,WEB_BASE_URL,APP_CONTEXT_PATH, etc) or configuration option in docker-compose/.env to set this prefix.Example: In
.env,IMMICH_BASE_PATH=/immich. The server would serve static assets and API routes prefixed accordingly, and the web UI would generate correct URLs with the prefix.In the Nginx config, one could do:
Should support both web UI and mobile app usage when the server endpoint URL includes the path:
https://domain.com/immich.Possible env variables / docker-compose suggestions:
In
docker-compose.yml/.env:In
docker-compose.ymlservice forimmich-server:In documentation, specify that if
IMMICH_BASE_PATHis set (non-empty), the server will internally mount its web assets and API under that path. Also update routing for websockets (e.g./socket.io/…) accordingly.Trade-offs / considerations:
immich.domain.com) remains the recommended approach.Steps to reproduce / environment:
https://domain.com/immichin browser./immich/static/..., websocket connection fails, API calls to/api/...rather than/immich/api/....Additional info:
Platform
All reactions