Can you send a screenshot of that „bad gateway“ message?
Some software requires special configuration when used behind Cloudflare, as Cloudflare sends special headers in the request marking the request as proxied - HomeAssistant does so, e.g.
With the screenshot we can check if it‘s a Cloudflare error, or an error in the application you are hosting
Its very strange when we go to domain/folder it shows the site but its not loading index.pho or something looks like there are more subdomains on the same server all working normal only the main domain get this messages. So what can be wrong here and it's since yesterday before months no issues and there is nothing changed on the server
I've seent he same error message recently. In that case, I think it was that the server only sent a partial response to Cloudflare before abruptly stopping.
Can you give the URL of the file and maybe explain how it is generated? What PHP version is used and such? Maybe something to do with a PHP update?