Domai.com/uri gives 500 error while ip:port/uri gives 200

HI, I have configured a lb rule on HAproxy and while doing curl -kv http://domain.co/some/uri gives 500 response code while curl -kv http://ip:port/some/uri gives 200. Could some one please suggest where the problem might reside or guide me some steps to troubleshoot this. Thanks in Advance