Got "502 Bad Gateway" on login callback when using NGINX reverse proxy

Ok, I’ve figured it out.
Here is what I found in Nginx logs:

2023/09/21 23:35:10 [error] 2659942#2659942: *522258 upstream sent too big header while reading response header from upstream, client: 192.168.168.1, server: my.hostname, request: "POST /callback HTTP/2.0", upstream: "https://192.168.168.135:7176/callback", host: "my.hostname", referrer: "https://my-domain.us.auth0.com/"

So it works fine after adding this buffer config to Nginx:

server {
 proxy_busy_buffers_size   512k;
 proxy_buffers   4 512k;
 proxy_buffer_size   256k;
 # rest of the nginx config below #
}

Don’t forget to bump your Nginx memory :slight_smile:

3 Likes