Set up a reverse proxy to circumvent domain blocking in particular regions or by certain extensions and DNS servers. Because experiment APIs are latency sensitive, Amplitude recommends approach using an edge hosted solution to minimize the round trip time from the proxy to Amplitude.
Follow these steps to create a new CloudFront distribution to proxy requests to Amplitude Experiment's evaluation servers. Any configuration field not explicitly mentioned in any steps can be left with the default value.
api.lab.amplitude.com
for the US data center or api.lab.eu.amplitude.com
for the EU data center.GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
as the Allowed HTTP methods and OPTIONS
as the Cache HTTP methods value. Cache HTTP methods appears when you select the Allowed HTTP methods value.CachingDisabled
cache policy, the AllViewExceptHostHeader
origin request policy, and the CORS-with-preflight-and-SecurityHeadersPolicy
response headers policy. The above selections require that you choose Cache policy and origin request policy (recommended) rather than Legacy cache settings.Test the new distribution with curl
request. To find the distribution domain name, select the new distribution from the list in CloudFront, copy the subdomain, and replace the SUBDOMAIN
in the following curl. Then replace APIKEY
with your deployment or project API key to authorize the request.
Successful requests return a 200
response.
1curl -i 'https://SUBDOMAIN.cloudfront.net/v1/vardata' -H 'Authorization: Api-Key APIKEY'
Thanks for your feedback!
May 31st, 2024
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.