Nginx proxy on a different location than /

Hello, we are new to Vikunja and we are considering to migrate from Trello.

We would like to add extra security, for now, by just hide the application from /, so we would like to have:

my .example.com/v_api
my .example.com/v_ui

By taking Reverse Proxy | Vikunja as hint we are successfully reach the api with:

location /v_api/ {
proxy_pass http://127.0.0.1:3456/;
}

However when we try to use the ui, we get 404 because (via chrome inspector) we can see that many contents are load as:
my .example.com/fonts/…
instead of
my .example.com/v_ui/fonts/…
(so missing v_ui as a context path)

Can you suggest a config that works in the way I explained?
Thanks a lot

After reading a bit the backlog, I found Hosting Vikunja in a subdirectory - #4 by kolaente

I’m able to to a rebuild, however I did not understand what exactly needs to be changed and where. Since grep -R publicPath has no result.

Can you point me in the right direction?
Thanks again.

You’ll need to pass the --base option to yarn build as described here: Building for Production | Vite

That’s a great starting point however:

yarn run build --base=/MYPATH
results in:
vite build && workbox copyLibraries dist/ --base=/MYPATH

So I find the trick by editing package.json directly from:
vite build && workbox copyLibraries dist/
to
vite build --base=/MYPATH && workbox copyLibraries dist/

so somehow the yarn argument is appended to the wrong command, but I understood the issue and I was able to fix it.
Now index.html and so on have /MYPATH everywhere.

Thanks a lot.

Ah yes in hindsight that makes sense. Didn’t think it through.

Glad you figured it out!