How can I set up traffic proxying in Route 53 like Cloudflare?

0
4
Asked By TechyNinja42 On

I'm trying to proxy traffic using AWS Route 53 similar to how it's done in Cloudflare with their orange cloud feature. I have a VPS with a static IP from Hetzner and I'm looking to route traffic through AWS, ideally combining Route 53 with CloudFront. However, I'm having trouble since CloudFront only seems to support origin URLs and not direct IP addresses.

I attempted to set up reverse DNS with an origin domain like origin.example.com pointing to my VPS IP. My setup looks like this: IP âž” origin.example.com âž” CloudFront âž” example.com. Sadly, this approach messes with image loading and some other resources on my site. It feels pretty hacky and I'm sure there must be a more elegant solution to proxy traffic through AWS without exposing the actual IP. Is there a straightforward way to achieve this using Route 53 and other AWS services?

2 Answers

Answered By AWSGuru56 On

Don't forget about the Host header! It's key to getting things right, especially when proxies are involved. If you don’t forward the Host header, your app might default to its own origin hostname instead of using the one you want, which can definitely cause issues with loading resources.

TechyNinja42 -

Yeah, I figured that out too. Once I forwarded the headers, it started working correctly. Appreciate the help!

Answered By CloudExpert99 On

What you've set up is actually a pretty standard configuration, not hacky at all. It sounds like the main issue might be in how your assets are loading. Have you checked your asset loading processes? My suggestion would be to ensure you're passing the Host headers correctly. If your app doesn't know it's behind a proxy, it might be creating wrong URLs, which could lead to the loading problems you’re experiencing.

TechyNinja42 -

I forwarded the headers and everything's working fine now, thanks for the tip! I'm not using Cloudflare because the client prefers everything on AWS.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.