Skip to content

nginx: forward Authorization; pass Content-Encoding; 10m body limit#35

Open
jorgealemangonzalez wants to merge 1 commit into
mixpanel:masterfrom
jorgealemangonzalez:fix/nginx-forward-headers-flags-replay
Open

nginx: forward Authorization; pass Content-Encoding; 10m body limit#35
jorgealemangonzalez wants to merge 1 commit into
mixpanel:masterfrom
jorgealemangonzalez:fix/nginx-forward-headers-flags-replay

Conversation

@jorgealemangonzalez
Copy link
Copy Markdown

@jorgealemangonzalez jorgealemangonzalez commented May 13, 2026

Why

We were having CORS issues with flags endpoint

Summary

Updates the Docker nginx proxy so it matches Tracking via proxy troubleshooting in the Mixpanel JavaScript SDK docs.

Changes (location /)

  • proxy_set_header Authorization $http_authorization; — The /flags endpoint requires forwarding the client Authorization header (see doc troubleshooting: 401 on feature flags).
  • proxy_pass_header Content-Encoding; — Helps Session Replay when Content-Encoding must survive the proxy (doc same table + Session Replay row).
  • client_max_body_size 10m; — Matches the client_max_body_size in the official nginx example on the same doc page.

Not in this PR

TipiInk also runs this image on Cloud Run (*.run.app), where browsers need extra CORS headers for cross-origin SDK calls (e.g. /flags). That is deployment-specific (first-party subdomain paths often avoid CORS entirely), so it is intentionally omitted here.

Made with Cursor

- Forward client Authorization header to api.mixpanel.com (fixes /flags 401 per SDK docs).

- Pass Content-Encoding from upstream for Session Replay.

- Set client_max_body_size 10m to match Mixpanel nginx example.

Refs: https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#tracking-via-proxy
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant