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.
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.
Comments
Similar requests
Add Reverse Proxy Support for Local Supabase Development
1 vote · 0 comments
Standardize Error Codes Across Supabase Ecosystem
1 vote · 0 comments
Improve supabase-py Proxy and TLS support
1 vote · 0 comments
Self host several instances of supabase at time
2 votes · 0 comments
Send error codes for errors
3 votes · 0 comments
No comments yet.