Cloudlfare throws 522/521 when reaching my website on firefox/w3m but works on Safari. Also firefox works on LAN

Ok new update! I switched from port 443 to port 8443. Now here comes the strange part: whenever i got to a normal url it throws a 521/522 but when i go to https://git.nazev.eu:8443/ it works just fine. And yes the record is proxied so you would think that the port doesnt matter in the url well it does… wierd.