How could I use N8N_EDITOR_BASE_URL?

I had these env:
N8N_HOST = n8n.mydomain.com
N8N_PROTOCOL = https
VUE_APP_URL_BASE_API = https://n8n.mydomain.com/
WEBHOOK_TUNNEL_URL = https://n8n.mydomain.com/

I have n8n used through reserve proxy at 5678

I want to set N8N_EDITOR_BASE_URL.
How could I set for https://n8neditor.mydomain.com/ ?

Could I set env like this:
N8N_HOST = n8n.mydomain.com
N8N_PROTOCOL = https
VUE_APP_URL_BASE_API = https://n8n.mydomain.com/
WEBHOOK_TUNNEL_URL = https://n8n.mydomain.com/
N8N_EDITOR_BASE_URL = https://n8neditor.mydomain.com/

And point subdomain n8neditor.mydomain.com to n8n.mydomain.com?

Hey @cmdntd987,

From what I remember that config value is mostly used for the user management emails.

If you wanted to use n8neditor.mydomain.com for the editor it should be a case of setting everything apart from the webhook url to that value then updating your dns records as needed.

Yes, but I do not know how that 2 env have 2 subdomain could point to the same ip address at port 5678. It seems n8n could use the same address for 2 subdomain, isn’t it?

It is like:
https://n8n.mydomain.com/ → ip:5678
https://n8neditor.mydomain.com/ → ip:5678

Could you instruct me how to do this exactly, please?

Hey @cmdntd987,

On your DNS or Reverse proxy you would need to set a new A record that points the hostname to the internal host and that should take care of it.

Exact instructions are a bit tricky as there are hundreds of way this could be done depending on what you are using for routing and how your DNS is managed.

n8n itself doesn’t really listen for connections on a specific host it is more what it displays in the front end and what it reports to the outside world.

Looking at your env example from an n8n side all you would need to do is something like the below then just make sure you are pointing the dns records to the correct location and you should be all good.

N8N_HOST = n8neditor.mydomain.com
N8N_PROTOCOL = https
VUE_APP_URL_BASE_API = https://n8neditor.mydomain.com/
WEBHOOK_TUNNEL_URL = https://n8n.mydomain.com/
N8N_EDITOR_BASE_URL = https://n8neditor.mydomain.com/

This won’t fully restrict the admin interface to just n8neditor.mydomain.com though to do that you would need to look at implementing network rules to prevent some of the URI paths from being loaded.

1 Like

I set WEBHOOK_TUNNEL_URL. But I read in your document has env WEBHOOK_URL.
Could you tell me bout different, and how to use it on this case, please?

Hey @cmdntd987,

My mistake there you will need to use webhook_url not webhook_tunnel_url.

Well, so WEBHOOK_TUNNEL_URL is wrong env variable?

I will point n8neditor.mydomain.com to ip:5678
How about n8n.mydomain.com? Should I point it to ip:5678?

I 'm using n8n.mydomain.com on port 80 now

You can point it to 5678 if you want, It depends on if it is listening on that port or not. To be honest though unless you are going to restrict paths so making sure only n8n.mydomain.com/webhook can go through you will still be able to access the editor on both URLs.

Could you help me how to restrict the admin to [n8n.mydomain.com]?
It seems be able to login to both, instead of only n8neditor.mydomain.com

Hey @cmdntd987,

What firewall / reverse proxy are you using and does it allow path restrictions?

Yes, it could.
But how to do it? Should I create any path in hosting?

Hey @cmdntd987,

You wouldn’t need to create any hosting paths unless that is how your system works.

You would need to only allow /webhook/* for the n8n domain then allow everything else for the n8n editor url.

It seems rather complex.

Could you have repo to upgrade n8n core to restrict webhook_url?
I thinks an env variable make it more simple.

It helps prevent bruce force attacks to webhook_url. Anyway, I do not want to depend to proxy panel because of path restrictions.

Hey @cmdntd987,

It could be worth a feature request although I am not sure it would actually help to prevent brute forcing the webhook URLs as you would be using the webhook url for other services to talk to.

We are always open to feature requests though and if the request idea is popular with the community it will have a higher chance of being added.

1 Like

Thanks. I created a request at:

Perfect, I suspect you will get a reply or 2 about implementing a service in front to restrict the URL paths but other than that all is good.

1 Like