Nginx reverse proxy shows 502 for Keycloak registration form submission

When I submit my registration form, I see the 502 error. However, use is created and I can see the user in the admin panel.

My configuration:

  • Docker standalone Keycloak

  • Reverse proxy using nginx

I can’t find out the reason. How should I fix this?

I have same problem and I fixed it with Nginx Proxy: upstream sent too big header while reading response header from upstream

if link is dead:
To resolve it, add the proxy_buffer_size configurations to your location block.

server {
  listen        80;
  server_name   host.tld;

  location / {
    proxy_pass       http://upstream;
    ...

    proxy_buffer_size          128k;
    proxy_buffers              4 256k;
    proxy_busy_buffers_size    256k;
  }
}