Bug - setting up oauth for

I’m getting an “OAuth Authorization Error - Request failed with status code 414” when trying to connect Google Sheets via OAuth2 in n8n. I’ve set up a Google Cloud OAuth app, enabled Google Sheets API and Google Drive API, added my email as a test user, and entered the full Client ID (including .apps.googleusercontent.com) and Client Secret. The OAuth Redirect URL shown in n8n is https://n8n.sovvex.com/rest/oauth2-credential/callback. The error appears as soon as I click “Sign in with Google” before the Google login page even loads. What is causing the 414 URI Too Long error and how do I fix it?

Welcome @Mohammad_Aoun to our community! I’m Jay and I am a n8n verified creator.

The 414 URI Too Long error before the Google login page even loads typically points to a proxy/server configuration issue, not a Google Cloud setup problem. If you’re running n8n behind Nginx or Apache, the default large_client_header_buffers size is often too small for OAuth authorization URLs (which include long scope strings).

For Nginx, add this to your server block:

large_client_header_buffers 4 32k;

If you’re not using a reverse proxy, also double-check that your N8N_EDITOR_BASE_URL and WEBHOOK_URL environment variables are set correctly - a misconfigured base URL can inflate the redirect URI and push it over the server’s header size limit.

If you are using a reverse proxy (such as Nginx, Traefik, Apache, or Cloudflare) to manage n8n.sovvex.com, that proxy has a default limit on how long a request URI or header can be. When the request exceeds this limit, the proxy rejects it with a 414 error before it even reaches the n8n application.

To confirm it is a header/cookie issue:

  • Try Incognito Mode: Open n8n in a private/incognito window and try to connect again. If it works, it means your standard browser session has accumulated too many cookies, pushing the request over the proxy’s limit.

  • Clear Cookies: Clear the cookies specifically for n8n.sovvex.com and try again.

After confirming it is due to proxy/server configuration issue, use @nguyenthieutoan’s approach if you use Nginx. Let us know if you use other reverse proxy for further help