How can I change the base directory for Metabase?

TL;DR version:

I am running the jar file version of Metabase and would like it to use mydomain.com:3000/metabase/ rather than mydomain.com:3000/.

Long version:
I want to use Apache’s mod_proxy to access Metabase as one of several apps on the system. I have other apps that work as mydomian.com/app1, mydomain.com/app2, etc. I’ve configured mod_proxy via the ProxyPass directives, but there is some flakiness to it. The reason has to do with Metabase being the root app. The various links refer to /api, /app, /dash, etc. I would like to set it so that they will refer instead to /metabase/api /metabase/app, /metabase/dash, etc. My proxy config for Metabase so far looks like

<Location /metabase>
ProxyPass myurl:3000
ProxyPassReverse myurl:3000

<Location /app>
ProxyPass myurl:3000/app
ProxyPassReverse myurl:3000/app

<Location /api>
ProxyPass myurl:3000/api
ProxyPassReverse myurl:3000/api

<Location /auth>
ProxyPass myurl:3000/auth
ProxyPassReverse myurl:3000/auth

<Location /q>
ProxyPass myurl:3000/q
ProxyPassReverse myurl:3000/q

<Location /dash>
ProxyPass myurl:3000/dash
ProxyPassReverse myurl:3000/dash

<Location /setup>
ProxyPass myurl:3000/setup
ProxyPassReverse myurl:3000/setup

The tags didn’t come through. Each of the ProxyPass statements is in a Location tag for the same folder name.

Metabase doesn’t support that currently.

See the discussion at https://github.com/metabase/metabase/issues/2090

1 Like

@tom has updated issue 2090 pointing to a discussion ou using react-router. I couldn’t figure out how this applies to metabase.

Can anyone clarify this a bit?

I am trying the same thing, but using nginx I can parse and replace strings in any content served by metabase.

Thanks.

I am also finding it difficult to follow what is needed to be done so that MetaBase can be run from a sub directory / folder e.g. /metabase or /mb

The discussion in https://github.com/metabase/metabase/issues/2090 suggests people have managed it, but please could someone add the example steps to the documentation for each of the install methods. Jar file, docker, mac os, nginx etc

@daviso15

You’re replying to a thread that is three years old. You should probably have created a new thread.

If you read the last comment on issue #2090, then you’ll see there’s a bug in the latest release of Metabase (0.33.4), which causes non-root proxying to not work. It will be fixed in 0.33.5

There are many ways doing the configuration for a reverse-proxy (and many different types of software), which is why there isn’t a guide for that.
Since I don’t know which web server you’re planning to use, then I cannot even give you a direct link, but try searching the internet for something like “nginx reverse proxy”