502 bad get way

The subdomain cannot connect to my server, while the connection through IP is working fine. I deleted and recreated a DNS record, and it connected successfully, but after about 10 minutes, the issue occurred again.