Hi @Gaurav Kumar
Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
Did you check if the policy in APIM which checks the original host of the request and routes it to the correct backend URL is working as expected. You can test this by sending requests directly to the APIM (bypassing the Application Gateway) and checking if they are routed correctly?
If the default SSL binding in APIM is set to domain1.com, it might cause issues when routing traffic from domain2.com. You might need to configure APIM to use the correct SSL certificate based on the original domain hostname of the request.
Kindly refer the below link which might be helpful in the configuration -