I’m integrating TikTok Lead Generation with my CRM using a self-hosted n8n instance on Hostinger, and I’m having an issue specifically with the OAuth2 callback step.
My goal is to connect TikTok’s Lead Generation API to n8n so I can automatically pull new leads and send them into my CRM (Salesforce). The TikTok Developer app and n8n OAuth2 credentials have already been configured.
What is working
– n8n successfully opens the TikTok authorization page
– I can log in
– TikTok displays “Authorized success”
– TikTok then redirects back to n8n’s OAuth2 callback URL (the standard /rest/oauth2-credential/callback endpoint)
The problem
After TikTok redirects back, the callback does not reach n8n.
Instead, Hostinger returns a 404 response before n8n can process the authorization code.
So the OAuth process cannot complete.
Environment
n8n is deployed using Hostinger’s built-in Docker environment.
n8n runs inside a Docker container, and Hostinger exposes it over HTTPS.
I did not configure any reverse proxy or web server manually; all networking is handled by Hostinger’s Docker hosting.
Current OAuth settings in n8n (summarized)
– Using TikTok’s standard authorization endpoint
– Using TikTok’s standard token endpoint
– App ID added through query parameters
– Scopes configured for ads and leads access
– Redirect URL is the default callback path that n8n provides
– Nothing customized beyond the standard n8n fields
Feedback so far
TikTok support confirmed that the authorization URL and redirect format are correct, and that the failure is happening on my server side because the callback endpoint returns 404.
n8n support said this is likely related to reverse proxy or hosting configuration on Hostinger since the endpoint is not reached, and suggested asking the community.
What I need help with
I’m trying to understand what needs to be configured on a self-hosted n8n installation (running as a Docker container on Hostinger) so that the OAuth2 callback endpoint is properly accessible.
In particular:
Does n8n require any special proxy rules for the /rest path when running behind a hosting provider’s Docker environment?
Are there environment variables that must be set for callback handling in this type of setup (for example N8N_ENDPOINT_REST, WEBHOOK_URL, or N8N_HOST)?
Has anyone successfully handled OAuth2 callbacks on Hostinger or a similar Docker-based hosting, and if so, what configuration was required?
Is there an alternative callback endpoint or REST path that works better for hosted setups like this?
The 404 error indicates that either the callback URL isn’t being routed correctly through Hostinger’s Docker environment, or n8n isn’t properly configured to handle the callback endpoint.
If WEBHOOK_URL or N8N_EDITOR_BASE_URL isn’t set correctly, n8n may not properly register the OAuth callback routes or may generate incorrect callback URLs.