Subpath host configuration

Hi, we’re planning to install different n8n instance for each of our tenant.

How can we configure n8n to serve different instances based on subpath?
our goal: http://owr.custom.domain/{{tenant}}

As for now we configure all variables like docs said without any success

Current Stack:
HAPROXY
n8n on docker

Welcome to the community @Cristiano_iimage!

Yes, that is currently not possible. n8n needs it own domain/subdomain to run correctly.

Tyvm 4 the fast reply.

For that who need similar goal we just build a docker image FROM n8nio/n8n with a custom build of editor-ui package with publicPath variable set to {{tenant}} value in the vue.config file just like this in the Dockerfile:

cd n8n/packages/editor-ui/
sed -i ‘s/module.exports = {/module.exports = { publicPath: process.env.FLOWUI_BASE_PATH,/g’ vue.config.js
echo “FLOWUI_BASE_PATH=${TENANT}” > .env.local
echo “VUE_APP_URL_BASE_API=/${TENANT}/” >> .env.local
npm install
npm run-script build

Now n8n works like a charm!

Thanks a lot for sharing the work-around! Is very appreciated!

I want to however mention that I am not sure if it will make make problems somewhere else in n8n. Is additionally also possible that it breaks in the future as it is currently not officially supported.

In the just released n8n@0.71.0 it is now possible to set the publicPath via the environment variable VUE_APP_PUBLIC_PATH which will make the above now partly obsolete.

Actually the previous did not really work. It is now however properly possible to run n8n in a subfolder with n8n@0.74.0

Here an example:

Is it possible in 2023 November?

Hey @Kylychbek,

From your other post I suspect you are already aware, I will be posting an update on that thread later today once I have had a chance to give it a test.

As this post is 3 years old now I am going to mark it as closed.