According to some puranas, Nandi was born out of the right side of Vishnu resembling Shiva exactly and given as a son to the sage Salankayana. Some puranas mention him as the son of the sage Silada who got him by the grace of Shiva.
It was Nandi who cursed Ravana that his kingdom would be burnt by a monkey (Vanara). And later Hanuman burnt Lanka when he went in search of Sita, who was kept prisoner by Ravana in Ashok Vatika. In one puranic story, it is stated that once Siva and Parvathi were playing a game of dice. For any game there has to be an umpire, who has to declare who is the winner. Siva and Parvathi agreed to have Nandi as the umpire. Nandi is a favorite of Siva, as he is Siva’s vehicle. Although Siva lost the game, Nandi declared him the winner. It is stated that Parvathi was indignant over Nandi’s partiality for Siva and cursed him that he should die from an incurable disease. Thereupon Nandi fell at the feet of Parvathi and pleaded for forgiveness. “Mother forgive me. Should I not show at least this amount of gratitude to one who is my master? Is it not humiliating for me to declare that my master has lost the game? To uphold his honor I no doubt uttered a lie. But am I to be punished with such severity for so small an offence?” Nandi prayed for forgiveness in this manner. Parvathi forgave Nandi and taught him the means to atone for his lapse. She told him. “The Chaturdasi day in the month of Bhadrapada is the day when my son’s birthday is celebrated. On that day you have to offer to my son what pleases you most (green grass)”. This means that one atones for one’s sins when one offers to the Lord what is most pleasing and enjoyable to him. For Nandi the most enjoyable and relishing food is green grass. As directed by Parvathi Nandi worshipped Ganapathi by offering green grass. Nandi was then relieved of his dreaded disease. His health improved and by the grace of Parvathi he was redeemed.