Cloudflare for SaaS / custom hostnames

I’m trying to set up Cloudflare for SaaS to use custom hostnames / vanity domains following this guide.

I’ve set my fallback origin and my CNAME target in the agolix.com DNS:

Note that my SaaS application lives at Agolix by Assessment Generator and is hosted on AWS.

I set up a test subdomain on wittsparks.com, with a CNAME from asmtcf.wittsparks.com to customers.agolix.com:

I configured my fallback origin in cloudflare, and added the custom hostname using automatic HTTP validation. Everything validated and shows as active:

When I visit https://asmtcf.wittsparks.com/assessment/3446, I get a 404. I expect to see the same content as True False Test.

Thank you for any assistance!

First of all, are you using Flexible SSL setting in Cloudflare? The 404 error for your https page includes this part: Server at asmtcf.wittsparks.com Port 80. An https connection shouldn’t be made on port 80.
You can (should) fix this by changing Cloudflare’s SSL setting to Full (strict).

Other then that, the error is clearly returned by your server, so you probably have some error in your vhost for asmtcf.wittsparks.com.

2 Likes

Thank you Laudian,

I actually didn’t have a virtual host entry for the subdomain - I thought that Cloudflare for SaaS was forwarding the content/responses. Adding that solved the problem.

My domain is set to Full (strict).

Thank you very much for your assistance!

2 Likes

If Cloudflare did that, then every custom hostname for the same origin would display the same site. That would not be very helpful for businesses that serve multiple customers from the same origin (though this is supported on Enterprise plans).

But it’s still weird that the connection was made to your server on port 80, I would recommend looking into that.

How did you determine that the request was made to port 80? When I look at chrome dev tools, it shows port 443:

Am I looking in the wrong place?

Thank you!

The 404 error message that I copied into my first post included the port.

The dev tools show you what port is used to connect to Cloudflare, not how Cloudflare connects to your server.

The fact that we were able to even see the error is a clear giveaway - without a vhost for the name, we should have seen a certificate error, not a 404.

Are you certain your main CF account is not using the flexible ssl option?

Here are the SSL/TLS settings for my agolix.com domain:

You said “for your main account.” Is there somewhere else this could be set?

Thank you!!

That’s strange. I haven’t tried CF for SaaS myself yet, but I’ll have a look at it tomorrow to see if there are any hidden settings.