Reverse Proxy (two different origin servers/CNAME's for the same domain) using Page Rules

proxy

#1

Originally I want to just reply to Reverse Proxy using Page Rules but since it is closed, I’m forced to create a new topic.

This was originally, but as I have found the answer I’m posting it here so that other people having the same question can find it.

The question: Can I use Cloudflare to serve a domain (say example .com) using two different servers based on path, i.e.:

example .com -> origin1.amazonaws .com
example .com/blog -> origin2.amazonaws .com

Note that the Host header is never changed.

All answers (@Judge) so far always mention this:

rewriting the HOST header is only possible with the enterprise plan to prevent abuse of 3rd-party services.

Fortunately I’ve found a thread on StackExchange, the feature I’m looking for is called Resolve Override, not Rewrite Host Header.

However, even without rewriting the Host header, Resolve Override is also only available in Enterprise plan.

@matteo mentioned using Cloudflare Workers, which could be interesting… But needs to mention that this also adds additional programming overhead on top of the Workers pricing, and competes with other alternatives from AWS and other cloud providers.


#2

For Cloudflare they are the sane thing, as the first is just a different name of the second. Resolve Override is available to everyone, it’s limited to the account’s domains for everyone except for Enterprise (still manual activation on Cloudflare’s side).

That is obviously true, Workers are by definition a serverless function running on Cloudflare’s nodes. The code is really simple though (simple JavaScript), just a couple of lines that you can basically copy off the documentation, but it still sends the host header of your site for the same reason as before mentioned.


#3

Sorry to correct: Resolve Override is not available to everyone, it’s Enterprise only, quoting Cloudflare itself on the Page Rules page:

What do Resolve Override and Host Header Override do (Enterprise only)?

Resolve Override changes the origin address that a request to a URL will be sent to. Host Override changes the Host Header on requests to that URL. More information is available on our knowledge base about Resolve Override and Host Header Override

However if you mean that Resolve Override is manually available to Free/Pro plans on a case-by-case basis (by request) then that is very interesting for me!


#4

In Page Rules you are correct, but talking generally it’s available in Workers (look in the Workers documentation: developers.cloudflare.com).

As for specific activation I have no idea but I really doubt it’s available.


closed #5

This topic was automatically closed after 31 days. New replies are no longer allowed.