nginx: forward Authorization; pass Content-Encoding; 10m body limit#35
Open
jorgealemangonzalez wants to merge 1 commit into
Open
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/flagsendpoint requires forwarding the clientAuthorizationheader (see doc troubleshooting: 401 on feature flags).proxy_pass_header Content-Encoding;— Helps Session Replay whenContent-Encodingmust survive the proxy (doc same table + Session Replay row).client_max_body_size 10m;— Matches theclient_max_body_sizein 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