I'm trying to set up mydomain.com/help that should pull content from mydomainhelp.otherdomain.com

I was told to use a apache mod_proxy, but I'm not a big fan of that approach.

I was wondering if I could achieve this using cloudfront. They let you specify the origin path, and if it allowed using a parent path notation (/..) it would work. So far, I have had no success. Anyone know how to make this work? Any other suggestions are welcome as well.


You can't do this with CloudFront (I believe), but you could do it with other CDNs.

Fastly allows various rules to route request to different origins, including by directory. See here: https://docs.fastly.com/guides/performance-tuning/routing-assets-to-different-origins

CloudFlare has similar functionality, albeit it is Enterprise only. See here: https://support.cloudflare.com/hc/en-us/articles/206190798


Answering my own question - This was not possible with CloudFront. I looked at other solutions that would allow me to make a reverse proxy without having to deploy my own server, in AWS.

Two potential solutions came out - one was to use AWS Lambda, and the other was to use API Gateway. I went the API Gateway route, and got it working. The only issue I faced was that relative links that started with /somepath had to be changed to /help/somepath and this took some effort, though this is nothing to do with API Gateway itself, and would have to be taken care of in any solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.