[Feature] Support base url on the web app #222

Closed
opened 2026-02-04 18:49:25 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @usikpavel on GitHub (Aug 22, 2022).

Describe the bug
Immich server is deployed using default docker-compose.yml on the private host (Windows10) at http://192.168.3.3:2283/
It is accessible via reverse proxy (Windows Server 2019, IIS 10) at public url http://pavelusik.ru/photosImmich/

Main page is loaded successfully, but is not working. The reason is that /_app/immutable/start-a8372751.js file relative path is wrong:

    import { start } from "/_app/immutable/start-a8372751.js";

and therefore error 404 occured.
All other files (css, js, json, favicon, etc) are loaded successfully by their correct relative addresses /photosImmich/...path...

Task List

  • I have read thoroughly the README setup and installation instructions.
  • I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

To Reproduce
Steps to reproduce the behavior:

  1. In browser, open developers console, Network tab
  2. Go to http://pavelusik.ru/photosImmich/
  3. See downloaded files and errors

Expected behavior

  • All files are downloaded by its relative paths /photosImmich/...path...
  • All links are correct too.

System

  • Server Version: v1.25.0_35-dev on Windows 10 running in docker
  • Public reverse proxy server: Windows Server 2019, IIS 10 (with modules URL Rewrite 2, Application Request Routing 3.0)

Additional context
docker-compose and env.zip

Originally created by @usikpavel on GitHub (Aug 22, 2022). **Describe the bug** Immich server is deployed using default _docker-compose.yml_ on the **private** host (Windows10) at `http://192.168.3.3:2283/` It is accessible via reverse proxy (Windows Server 2019, IIS 10) at **public** url [http://pavelusik.ru/photosImmich/](http://pavelusik.ru/photosImmich/) Main page is loaded successfully, but is **not working**. The reason is that `/_app/immutable/start-a8372751.js` file relative path is **wrong**: ``` import { start } from "/_app/immutable/start-a8372751.js"; ``` and therefore **error 404 occured**. All other files _(css, js, json, favicon, etc)_ are loaded **successfully** by their **correct relative addresses** `/photosImmich/...path...` **Task List** - [x] I have read thoroughly the README setup and installation instructions. - [x] I have included my `docker-compose` file. - [x] I have included my redacted `.env` file. - [x] I have included information on my machine, and environment. **To Reproduce** Steps to reproduce the behavior: 1. In browser, open developers console, Network tab 2. Go to [http://pavelusik.ru/photosImmich/](http://pavelusik.ru/photosImmich/) 3. See downloaded files and errors **Expected behavior** - All files are downloaded by its relative paths `/photosImmich/...path...` - All links are correct too. **System** - Server Version: `v1.25.0_35-dev` on `Windows 10` running in `docker` - Public reverse proxy server: `Windows Server 2019`, `IIS 10 (with modules URL Rewrite 2, Application Request Routing 3.0)` **Additional context** [docker-compose and env.zip](https://github.com/immich-app/immich/files/9394830/docker-compose.and.env.zip)
OVERLORD added the nice to have label 2026-02-04 18:49:25 +03:00
Author
Owner

@alextran1502 commented on GitHub (Aug 22, 2022):

I think the problem here is that you have /photosImmich append to the URL. So you will need to proxy or rewrite any /api to http://192.168.3.3:2283/api If you use your domain as photoImmich.pavelusik.ru it should work

@alextran1502 commented on GitHub (Aug 22, 2022): I think the problem here is that you have `/photosImmich` append to the URL. So you will need to proxy or rewrite any `/api` to `http://192.168.3.3:2283/api` If you use your domain as `photoImmich.pavelusik.ru` it should work
Author
Owner

@usikpavel commented on GitHub (Aug 22, 2022):

Do you mean that Immich-web can run only in root path?

Another files are downloaded properly.
Mobile app (Android) works correctly (/photosImmich/api path is ok).

The problem is only in Web-app, and is related only to /_app/immutable/start-a8372751.js file. When opening another page manually auth/login, there is the same error. Login request works correctly, but loaded page has the same error.

@usikpavel commented on GitHub (Aug 22, 2022): Do you mean that Immich-web can run **only** in root path? Another files are downloaded properly. Mobile app (Android) works correctly (`/photosImmich/api` path is ok). The problem is only in Web-app, and is related only to `/_app/immutable/start-a8372751.js` file. When opening another page manually [auth/login](http://pavelusik.ru/photosImmich/auth/login), there is the same error. Login request works correctly, but loaded page has the same error.
Author
Owner

@alextran1502 commented on GitHub (Aug 22, 2022):

I might have the wrong assumptions.

I think what you do is fine, it seems the proxy is working fine as well. I am not sure why that file isn't loaded correctly. Let me do some digging.

At the mean time, can you try to pull immich-web container again and start it backup?

@alextran1502 commented on GitHub (Aug 22, 2022): I might have the wrong assumptions. I think what you do is fine, it seems the proxy is working fine as well. I am not sure why that file isn't loaded correctly. Let me do some digging. At the mean time, can you try to pull `immich-web` container again and start it backup?
Author
Owner

@usikpavel commented on GitHub (Aug 23, 2022):

All containers are up-to-date:

>docker-compose pull
Pulling immich-web              ... done
Pulling redis                   ... done
Pulling database                ... done
Pulling immich-machine-learning ... done
Pulling immich-microservices    ... done
Pulling immich-server           ... done
Pulling immich-proxy            ... done

> docker-compose up -d
immich_redis is up-to-date
immich_postgres is up-to-date
immich_immich-web_1 is up-to-date
immich_immich-server_1 is up-to-date
immich_immich-machine-learning_1 is up-to-date
immich_immich-microservices_1 is up-to-date
immich_proxy is up-to-date
@usikpavel commented on GitHub (Aug 23, 2022): All containers are up-to-date: ``` >docker-compose pull Pulling immich-web ... done Pulling redis ... done Pulling database ... done Pulling immich-machine-learning ... done Pulling immich-microservices ... done Pulling immich-server ... done Pulling immich-proxy ... done > docker-compose up -d immich_redis is up-to-date immich_postgres is up-to-date immich_immich-web_1 is up-to-date immich_immich-server_1 is up-to-date immich_immich-machine-learning_1 is up-to-date immich_immich-microservices_1 is up-to-date immich_proxy is up-to-date ```
Author
Owner

@panoti commented on GitHub (Aug 23, 2022):

@usikpavel Immich web can not work perfectly with path prefix now because of web framework config. You'd better use mobile only if you still wanna use path prefix, or use subdomain instead. I hope immich team will fix support it soon.

@alextran1502 I have a small test with web, Svelte kit not support base url perfectly because goto function not use base url in default. If we support base url, we have to pass base url to all goto function, IMO.

@panoti commented on GitHub (Aug 23, 2022): @usikpavel Immich web can not work perfectly with path prefix now because of web framework config. You'd better use mobile only if you still wanna use path prefix, or use subdomain instead. I hope immich team will ~fix~ support it soon. @alextran1502 I have a small test with web, Svelte kit not support base url perfectly because `goto` function not use base url in default. If we support base url, we have to pass base url to all `goto` function, IMO.
Author
Owner

@nando2301 commented on GitHub (Nov 8, 2022):

I have problem using HAProxy as SSL termination using something like https://domain.com/immich

image

I added ACL to manage /immich and /fonts/*** but does not work.

@nando2301 commented on GitHub (Nov 8, 2022): I have problem using HAProxy as SSL termination using something like https://domain.com/immich <img width="1439" alt="image" src="https://user-images.githubusercontent.com/32605309/200654693-b0ae58a2-b0b1-4645-9876-1645c21f2ba1.png"> I added ACL to manage /immich and /fonts/*** but does not work.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#222