Turning on proxy for CNAME results in 522 errors and Mime-Type errors

Having a pretty strange issue. My DNS records point to a nginx server, which is running authelia.

Initially, my DNS records were set up as:

A mydomain.com my.ip.goes.here
CNAME * mydomain.com

The A record was originally proxied, but the CNAME was not.

Everything worked as expected. But I noticed that Cloudflare was saying the CNAME would leak my IP address, so I enabled the proxy there, too.

Abruptly, everything broke. I get 522 on random requests, but others seem to have no issue. I also get console errors about mime types not matching (headers are showing text/html when they should be CSS or JS). Turning the proxy on the CNAME back off causes this to go away.

I thought, well, maybe there’s an issue with the wildcard, so I tried the following, with proxies turned on for everything. But this didn’t make any difference:

A mydomain.com my.ip.goes.here
CNAME www mydomain.com
CNAME subdomain1 mydomain.com

Here’s what it looks like at the moment:

And I have read Troubleshooting Cloudflare 5XX errors · Cloudflare Support docs

Hi @accounts61
Please see here for help with 522 errors:

If possible, can you post a screenshot of the console error, and a URL for us to reproduce this?

I literally linked that in my post :stuck_out_tongue:

Far as sharing a URL, is there a way I can send that to you without posting it publicly? This is a small-scale server for personal use and does not have much in the way of resources.

Disabling the proxy on the CNAME record makes all of those errors go away. Weird part is the page itself loads. It doesn’t render much due to the errors, but I don’t get Cloudflare’s 522 error.

On initial load:


After a few seconds:

Hello- I still have not found a solution for this. I don’t want this thread to be closed, so I guess I am forced to bump the thread?