The deployment is through Docker in Server, with version 1.41.0, and port 5678. The access method is public network access. The server uses Nginx for forwarding, utilizing https, and the access domain ht-tps://n8n.website.cn is forwarded to the local server port 5678. In this case, the default OAuth Redirect URL will include the port, so the environment variable WEBHOOK_URL was set to ht-tps://n8n.website.cn/, making the final Redirect URL: ht-tps://n8n.website.cn/rest/oauth2-credential/callback
There was a problem when attempting to perform Auth operations with Google Calendar, where the n8n callback returned a 504. Currently, it is unclear where the problem lies.
I have investigation:
After completing the Google Calendar Auth steps, it will redirect to the corresponding n8n auth callback. ht-tps://n8n.website.cn/rest/oauth2-credential/callback?state=xxxxxxxxx&code=xxxxxx&scope=ht-tps://www.googleapis.com/auth/calendar.events%20ht-tps://www.googleapis.com/auth/calendar This indicates that the configuration in Google Cloud is correct.
Direct access to ht-tps://n8n.website.cn/rest/oauth2-credential/callback does get a corresponding response, so why is a 504 Gateway failure received after parameters are added?
I’ve done a lot of investigation but still haven’t found the root cause.
Can you provide more insights to help me identify the real root cause? Oh, by the way, I’ve only connected to Github and Google Auth so far, and Github is successfully connected. @jan@ria Can you please help me solve this problem?
Seems that nginx is trying to pass the request to itself instead of the n8n server (but maybe it’s ok, I’m not familiar with nginx setup). Also, upstream has an HTTP protocol, but I see in the ENVs that you have set n8n to use HTTPS. Check the nginx configuration