NextJS and OAuth throws 502 Error - Nginx config issue fixed

Hi guys,

I just spend half a day figuring out why my NextJS App throws a 502 Error after logging into my Google account.

I am leaving this message here for the Cleavr team to assess and hopefullty update the Nginx config template so that others dont run into the same problem.

I am using Next 14 App dir, Supabase Auth and Google Provider.

Anyone who comes across the same problem can fix it by adding these two lines to the Nginx config:

  1. Go to: Sitesapp.example.comSite Nginx Config
  2. Add these two lines after proxy_connect_timeout 240;
  proxy_buffers 8 16k;
  proxy_buffer_size 32k;
1 Like