Help Needed: Google OAuth redirect_uri_mismatch with n8n on Synology Docker Setup
Hi everyone, I’m encountering a redirect_uri_mismatch
error while trying to set up Google OAuth in n8n running on Synology Docker.
Here’s my setup:
- n8n is running in Docker on my Synology NAS.
- Docker port mapping:
56787:5678
- Synology Reverse Proxy:
https://example.com:56788
→http://localhost:56787
- Router NAT: External
56788
→ Internal56788
- In Google Cloud Console, my authorized redirect URI is:
https://example.com:56788/rest/oauth2-credential/callback
But when I try to connect Google OAuth in n8n, I get this error:
Error 400: redirect_uri_mismatch
Requested redirect URI:https://example.com:56788/rest/oauth2-credential/callback?flowName=GeneralOAuthFlow
I did include the exact same redirect URI in Google Console (without the query string, of course).
I’ve confirmed the following:
- HTTPS is used
- Port 56788 is reachable from the internet
- Domain and URI path are correct
- No typos or trailing slashes
- I’m editing the correct OAuth 2.0 client in the correct Google project
- Set env variable:
N8N_HOST=example.com N8N_EDITOR_BASE_URL=https://example.com:56788 WEBHOOK_URL=https://example.com:56788
Still, I get the mismatch error. Any ideas what might be causing this?
Could it be due to caching in n8n, or something subtle in Google Cloud?
Thanks in advance for any help!
Information on your n8n setup
- n8n version: 1.93.0
- Database (default: SQLite): SQLite
- n8n EXECUTIONS_PROCESS setting (default: own, main): own
- Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
- Operating system: Synology DSM 7.2.2-72806 Update 3