n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
45.79k stars 6.4k forks source link

Cannot set the incoming URL for reverse proxy scenarios #1449

Closed flypenguin closed 3 years ago

flypenguin commented 3 years ago

Describe the bug Cannot set the incoming URL, see #1431 - "re-open". THIS IS NOT SOLVED BY SETTING N8N_PORT!

To Reproduce Steps to reproduce the behavior:

  1. start n8n using: N8N_HOST=thing.thang.thong:8080 node_modules/n8n/bin/n8n
  2. see this on startup: http://thing.thang.thong:8080:5678/
  3. check HTTP trigger nodes, which will have the same setting (which won't work, of course)

Expected behavior to see this: http://thing.thang.thong:8080/ [UPDATE 2021-02-16] - corrected port to :8080

Environment (please complete the following information):

Additional context THIS IS NOT SOLVED BY SETTING N8N_PORT!

Why not?

Updates

flypenguin commented 3 years ago

hi @janober , sorry for basically just re-opening the bug, unfortunately setting N8N_PORT is not the solution, it doesn't even work. (well it set the port n8n listens on, which is what it should do - it's just not solving the problem while creating a new one). i hope my updated description is understandable, I can provide screenshots and more detailed information if not.

krynble commented 3 years ago

Hello @flypenguin

If your goal is to have n8n running on port 8080, what you must do is:

export N8N_PORT=8080
export N8N_HOST=thing.thang.thong
npm run start

Also from the last issue, if you want port 18443, what you must do is:

export N8N_PORT=18443
export N8N_HOST=thing.thang.thong
npm run start

PS: You should never set the port number on the host variable.

Let me know if this helps you.

flypenguin commented 3 years ago

hi @krynble , no. 😄

let me explain:

I even made a picture ...

grafik

flypenguin commented 3 years ago

and yes, you could set the port to 80, but then you would have http://my.n8n.com:80/webhook/... as given url, which is at least ugly, cause it should be either http://my.n8n.com/... (without port) or even better https://my.n8n.com/....

Also if this is all on the same host (for example for explicit SSL offloading by a prefixed reverse proxy, which we are doing for a lot of apps) it's no longer working.

janober commented 3 years ago

Then what you actually want is to set the "WEBHOOK_TUNNEL_URL" environment variable as documented here: https://docs.n8n.io/reference/configuration.html#webhook-url

And please post the next time to https://community.n8n.io as GitHub issues are only for bugs.

flypenguin commented 3 years ago

@janober thanks a lot, this is exactly what i was looking for. weird i missed this. and yes, I considered the perceived non-exitance of this feature ... a bug.

janober commented 3 years ago

Glad to hear that it worked!

If not 100% sure that it is a bug it is always best to post first in the forum. Only then can we make sure that there is one single location where people can search for a solution instead of multiple different ones. In this example would it now be hard for someone else who has the same problem you had, and who would phrase it the same way, to find this solution.

So I ask for that not because I simply want to complain ;-) I simply want to make sure that people find a solution to their problem as easily and as fast as possible.

flypenguin commented 3 years ago

yeah you're right ... I always started to look for the question in the forum, and then I had to remember to go to github. will do :)

janober commented 3 years ago

Thanks. Have fun!