FeatureFuel
19

Error 502 with Supabase client when using Nginx as a reverse proxy

Source: supabase/supabase#29211 · opened by @sirtrade
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:
1. Set up a Next.js app with Supabase client in the middleware.
2. Use Nginx as a reverse proxy for the app.
3. Set cookies using Supabase's setAll method in the middleware.
4. Observe the 502 error.

Resolution:
The issue was resolved by increasing the large_client_header_buffers and 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.

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests