I have a standard docker self hosted community version of n8n Ver 1.82
running on ubuntu 22.04
dedicated server with no other function.
using DNS it is available as subdomain n8n.mydomain.com
Works great for years
Recently moved it behind Cloudflare by changing hostname to Cloudfalre
use Cloudflare DNS (no proxy) to the subdomain.- everything works
EXCEPT
Now when I try and create a new google credential I have an issue.
Cloudflare does not pass port 5678 through.
When i sign in with google to grant access to the app. I get almost to the end and then after displaying what permissions I wish to grant. it then errors out with the
ERR_CONNECTION_REFUSED
this is because Cloudflare is not passing the URI through.
Iām confused because i thought cloudflare in DNS mode only should allow this.
However having exhausted that avenue I wonder how we might configure the N8N oauth uri to be using port 2083 rather than 5678.
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Usually, callbacks are on port 443, why do you need it on port 2083?
Check if the redirect URI matches the URI you have set in Google account.
And check if the certificate for your site is valid
port 5678 is the default port that n8n is listening to. You can change it with the environment variable N8N_PORT. There is also a separate variable for webhooks URL either, but dunno if it works for credentials.
But listening the 443 port directly is not safe as your n8n service will be explicitly available to public. Generally, n8n is placed behind the proxy/ALB and the schema will look like this:
ALB/proxy is listening the HTTPS port (publicly available), then it sends all the requests to the n8n on port 5678.
n8n is not accessible from the outside and receive traffic only form that ALB/proxy. So everybody is happy