"502 Bad Gateway" Error on Login Callback When Using NGINX Reverse Proxy
Last Updated:
Overview
This article addresses an issue where some users are unable to sign in when using an NGINX reverse proxy. After attempting to log in, the following error message is displayed:
502 Bad Gateway nginx
Applies To
- NGINX
- Reverse proxy
Cause
This error can occur when the NGINX buffer memory is too low to process large headers for some users, such as those with long email addresses.
The NGINX logs may show the following related error:
upstream sent too big header while reading response header from upstream
Solution
Increase the NGINX buffer memory by adding the following configuration to the NGINX server:
server {
proxy_busy_buffers_size 512k;
proxy_buffers 4 512k;
proxy_buffer_size 256k;
# rest of the nginx config below #
}