Reverse Proxy with NGINX

When using Cadenza behind an NGINX reverse proxy here are some things to look out for:

Disable Proxy Buffering

Cadenza uses server sent events (SSE) as mentioned on the parent page. To prevent issues with NGINX buffering content, you will have to disable proxy buffering:

server {
		…
        location /cadenza {
				…
                proxy_buffering off;
                …
        }
}

Increase the Header Buffer Size

When using identity management products like Keycloak, the authorization header can be quite big and thus the proxy requests might fail. To mitigate the issue, you will need to increase the default value of a directive. These directives must be placed in the http or server context.

large_client_header_buffers 4 32k;

Requests with OPTIONS

HTTP OPTIONS requests can lead to a wrong HTTP reponse code (HTTP 204 — No Content instead of HTTP 200 — OK) when using nginx on Kubernetes. The following setting allows these requests:

nginx.ingress.kubernetes.io/enable-cors: "true"