Why am i getting 504 Gateway Time-out when connecting twitter?

I’m trying to enter the X credentials after creating client ID and secret ID but when i connect it loads and then returns 504 Gateway Time-out.
I’m working locally


## Share the output returned by the last node
<!-- If you need help with data transformations, please also share your expected output. -->

## Information on your n8n setup
- **n8n version:1.78.0
- **Database (default: SQLite):Postgres
- **n8n EXECUTIONS_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

Can you provide some more context? Did you make the connection successfully? Or the login popup showed 504? You could have not set the redirect URI via x correctly.

That could usually imply server load or endpoint went down.

I’m self-hosted so my url is localhost****** , and I followed the instructions on the n8n documentation for self-hosted
But when i’m trying to set the LinkedIn connection it provides a callback url that is on n8n cloud, i think that’s the problem, so how can i connect to LinkedIn when I’m using self-hosted n8n?

Docker self hosted? You may have to change your env variables to have it update the URL correctly.

You will have to update these:
environment:
- N8N_EDITOR_BASE_URL=http://127.0.0.1:port
- N8N_HOST=127.0.0.1:port

But I am unsure if n8n will function correctly with a fully localhost IP.

URL mismatch between redirect URI and the one set in the connection will always cause issues.

i did a workaround using ngrok and assigning a webhook and worked

Awesome glad you found something! If my reply was any help, would appreciate marking as solution, else you can on yourself.