I have 400 error when try to set host domain and webhook url

Hi, I try to set host domain and webhook url
Error Bad Request (400)

** Note: I install n8n by pm2 (not docker)

Environment set for this:

"N8N_HOST": "io.domain.net",
	    "N8N_PROTOCOL": "https",
	    "VUE_APP_URL_BASE_API": "https://io.domain.net",
	    "WEBHOOK_TUNNEL_URL": "https://io.domain.net"

How could I check and debug for this?

Hey @cmdntd987!

Maybe this post can help: Setting basic auth when running n8n with pm2

You might want to configure it when starting the service with pm2.

This link is almost about user and passwd for pm2 apps. I 've done that

My issue is about port 443 and URL_BASE, WEBHOOK_URL on own server for n8n

Ahh yes. I shared that because it shows how to set up the environment variables in pm2. Are you using the ENV_NAME=VALUE pm2 restart n8n --update-env command to set the variables?

Yes, I used that to set pm2 variables. That’s not my issue.
Now, I do not know how to map n8n from 5678 to a domain (443) for URLs
And Let’s encrypt for SSL is better on this

I set some environments above, but get 400 error…

In this case, you might need a reverse proxy. I also tested changing the port to 443 using N8N_PORT=443 pm2 restart n8n --update-env and I was able to access n8n on port 443. I am running this locally and haven’t got a chance to try it on a server. Also, I have a limited knowledge on pm2, so I am just trying all the possible solutions for you :slight_smile:

I tested
This does not map to submain https//io.domain.net correctly
It will overwrite 443 of all subdomains, and make server die.

"N8N_PORT": 443 # Same issue for "PORT": 443
"N8N_HOST": "io.domain.net",
	    "N8N_PROTOCOL": "https",
	    "VUE_APP_URL_BASE_API": "https://io.domain.net",
	    "WEBHOOK_TUNNEL_URL": "https://io.domain.net"

Could you have other way to route 5678 to 443 on pm2?

Sorry we are sadly no pm2 experts. We are very good with n8n specific problems but very helpless with other tools.
If you have already port 443 in use, then pm2 can also not help you. It is not about routing traffic it is about making sure that the application keeps on running and gets monitored. If you want to route traffic you have to do hat with for example nginx. You can then start n8n via pm2 (on more or less any port) and then tell configure nginx to route the traffic depending on the domain to either the service you have already running or to n8n.

We officially support running n8n via Docker. You can find the full tutorial which covers literally everything including Lets Encrypt here:

In this guide do we use traefik. That can also be used to route the incoming connections. So you could also use that as a base and change it to your custom needs. But also here are we neither experts in pm2, nginx or traefik. So depending on the way you choose you would have to check their documentation.