Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

n8n context path (BASE_PATH?) not being set correctly #9191

Open
chrism417 opened this issue Apr 22, 2024 · 1 comment
Open

n8n context path (BASE_PATH?) not being set correctly #9191

chrism417 opened this issue Apr 22, 2024 · 1 comment

Comments

@chrism417
Copy link

chrism417 commented Apr 22, 2024

Bug Description

I'm simply trying to configure n8n to listen at https://somedomain.com/n8n/, however no matter what env variable I set, it doesn't work.

I've tried all of the following env variables, removing the leading / and adding it back for each one.

 -e N8N_PATH=/n8n/ \
 -e N8N_EDITOR_BASE_URL=n8n/ \
 -e N8N_DIAGNOSTICS_ENABLED=false \
 -e N8N_PUBLIC_API_ENDPOINT=n8n/api \
 -e N8N_ENDPOINT_REST=n8n/rest \
 -e N8N_LOG_LEVEL=verbose \
 -e N8N_ENDPOINT_WEBHOOK=n8n/webhook \
 -e N8N_ENDPOINT_WEBHOOK_TEST=n8n/webhook-test \
 -e N8N_ENDPOINT_WEBHOOK_WAIT=n8n/webhook-wait \
 -e N8N_ENDPOINT_FORM_TEST=n8n/form-test \
 -e VUE_APP_PUBLIC_PATH=n8n/ \

With this current set of env variables, I'm getting 404s on all of the paths: /n8n/assets/*

To Reproduce

Run this with Docker:

docker volume create n8n_data

docker run -it --rm \
 --name n8n \
 -p 5678:5678 \
 -e N8N_PATH=/n8n/ \
 -e N8N_EDITOR_BASE_URL=/n8n/ \
 -e N8N_DIAGNOSTICS_ENABLED=false \
 -e N8N_PUBLIC_API_ENDPOINT=/n8n/api \
 -e N8N_ENDPOINT_REST=n8n/rest \
 -e N8N_LOG_LEVEL=verbose \
 -e N8N_ENDPOINT_WEBHOOK=/n8n/webhook \
 -e N8N_ENDPOINT_WEBHOOK_TEST=/n8n/webhook-test \
 -e N8N_ENDPOINT_WEBHOOK_WAIT=/n8n/webhook-wait \
 -e N8N_ENDPOINT_FORM_TEST=/n8n/form-test \
 -e VUE_APP_PUBLIC_PATH=/n8n/ \
 -v n8n_data:/home/node/.n8n \
 docker.n8n.io/n8nio/n8n

Go to http://localhost:5678/n8n/ with developer tools on > network and you'll see all the 404s to /n8n/assets/

Expected behavior

Going to http://localhost:5678/n8n/ brings you to the sign-in page, and therefore if I do https://somedomain.com/n8n/ it would also bring you to the sign-in page.

Operating System

Alpine Linux 3.19.1

n8n Version

1.37.0

Node.js Version

18.19.1

Database

SQLite (default)

Execution mode

main (default)

@netroy
Copy link
Member

netroy commented Apr 23, 2024

unfortunately running N8N_PATH only works with url-rewrites on a reverse-proxy in front of n8n.
Here is an example for traefik.

If it's possible for you to use a subdomain instead, please do that, since N8N_PATH has no tests, and not used by any of our instances or dev setups. Which means that even if you get it working today, there are (unfortunately) currently no guarantees that it would continue to work in the next releases.

Considering how few people use this option, we are considering deprecating it, and completely removing in the next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants