Error 502 with Supabase client when using Nginx as a reverse proxy #29211
Replies: 5 comments 1 reply
-
|
I've been fighting with this error. Thanks!!!! |
Beta Was this translation helpful? Give feedback.
-
|
Thanks so much! |
Beta Was this translation helpful? Give feedback.
-
|
Bro you saved my life |
Beta Was this translation helpful? Give feedback.
-
|
@fullgream This is super helpful. Do you mind elaborating on why this fixes the issue? Just trying to understand how to figured out this was needed, and wanting to learn a bit more about supabase/nginx in the process. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks so much!!! Saved me tons of work! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I encountered an issue with Supabase in my Next.js application when using Nginx as a reverse proxy. The application was returning a 502 error when attempting to set cookies with the Supabase client in the middleware. After investigating, it turned out that Nginx had limitations on header size and request timeouts, which caused the issue.
Steps to reproduce:
setAllmethod in the middleware.Resolution:
The issue was resolved by increasing the
large_client_header_buffersand timeout settings in Nginx config:Would it be possible to include a note in the documentation about this issue, or improve how Supabase interacts with proxy servers like Nginx in terms of header size and timeouts?
I hope this information helps someone.
Beta Was this translation helpful? Give feedback.
All reactions