I have configured an Amazon Web Services Application Load Balancer with a few registered targets that are basic web applications. I have created a CNAME in CloudFlare and pointed this (using DNS ONLY option) to the A Record endpoint of my ALB. Things work how I would expect here and the setup feels pretty slick.
I have created a listener on the ALB with rules so that requests to different subdomains or specific paths are routed to the correct target application like so:
IF host matches 'BLOG.mysite.com' --> target containing blog app
IF host matches 'mysite.com/V1/CHAT' --> target containing chat API
DEFAULT --> default target
Things go haywire when I turn CloudFlare's HTTP Proxy ON for this CNAME. Requests to the CNAME which would usually return a working webpage (html and shortly after assets like JS, css and images) time out. This is disappointing because CloudFlare's HTTP Proxy is available to me at no additional cost and offers a myriad of security features like DDos protection, etc.
Does anyone know why this happens and how to get around it? Does the ALB not have access to the host of the request from the internet when HTTP proxy is turned on?
UPDATE: What I believe is happening is that my ALB rules containing a match case on the HOST stop working when CloudFlare HTTP Proxy is turned on because the host name is changed or modified. However, I have yet to prove this.