Federated Authenticate w/ NGINX -> 502 Bad Gateway Error

Running into an issue that prevents logins from some google auth identity providers. User-Password Auth and Google Auth for one of my accounts seems to work.

I seem to be getting a callback from http://accounts.youtube.com/accounts/setSID with this specific account.

NGINX Config

location /api/auth/callback {


{"error":"not_authenticated","description":"The user does not have an active session or is not authenticated"}

EDIT: Something more ridiculous I noticed, some password-username combinations hit a “502 Gateway” error as well. Including: fake1231231241241521512512512562151252151@gmail.com

The trend is working logins are refer-policy = same origin and non-working are strict origin when cross origin

EDIT 2: So strange! After more testing, seems like password-username authentication breaks as soon as email_length >= 51 characters.

To clarify, http://accounts.youtube.com/accounts/setSID is a part of the Request Call Stack.