I’m not up to date on DNS stuff, but I’m wondering whether there are technical limitations stopping Glitch from supporting a direct CNAME link (or any other sort) from Cloudflare? I’m using Glitch for some projects that get a lot of traffic, and so I really need a cache in front and thus can’t use custom domains directly.
On the Cloudflare forum a mod said this a couple of years ago:
We send the host header with the request. However the origin is not configured to accept the host header in the request which is your sub(domain). The same behavior occurs whether the record is proxied or passed-through.
It does not appear that glitch has a mechanism to designate additional supported CNAME aliases for the host. At Cloudflare unless you are on an ENT plan we don’t allow you to change the host header unfortunately for security reasons.
Is there any possibility of supporting a direct link between Cloudflare and Glitch? I’m currently using a “proxy” DigitalOcean server for all my projects, which isn’t ideal.
(Note: I know you can do this with Cloudfront, but it’s not free, and in fact is absurdly expensive if you have a decent amount of traffic/bandwidth. Also note that there’s a very old discussion about this here.)
It looks like you’re pointing the CNAME at a non-glitch subdomain? (.preview.edge...)
When I try a CNAME record with a Glitch subdomain it gives the “project not found” page, which is what it has always done, as far as I know. I would be happy to be wrong here though! Perhaps it was fixed, and there’s some trick beyond a simple CNAME that you need to use?
and it seems that Glitch or fly.io mess with the IP anyway, so there is no way to get it on nodejs (I saw a package), but @RiversideRocks found a method for PHP