Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reverse Proxies

Overview

This topic explains reverse proxy configuration settings for the Relay Proxy.

HTTP proxies such as corporate proxies and WAFs, and reverse proxies in front of Relay such as nginx, HAProxy, and ALB are common in LD Relay deployments. This table lists settings to configure:

SettingConfigurationNotes
Response buffering for SSE endpointsDisableIt is common for reverse proxies to buffer the entire response from the origin server before sending it to the client. Since SSEs are effectively an HTTP response that never ends, this prevents the SDK from seeing events sent over the stream until the response buffer is filled or the request closes due to a timeout. Relay sends a special header that disables response buffering in nginx automatically: X-Accel-Response-Buffering: no
Forced Gzip compression for SSE endpointsDisable if the proxy is not SSE awareGzip compression buffers the responses
Response Timeout or Max Connection Time for SSE EndpointsMinimum 10 minutesAvoid long timeouts because while the SDK client reconnects, you can end up wasting resources in the load balancer on disconnected clients.
Upstream or Proxy Read Timeout5 minutesThe timeout between successful read requests. In nginx, this setting is called proxy_read_timeout
CORS HeadersRestrict to only your domainsSend CORS headers restricted to only your domains when using LD Relay with browser SDK endpoints
Status endpointRestrict accessRestrict access to this endpoint from public access
Metrics or Prometheus portRestrict accessRestrict access to this port