The Bible prohibits the worship of the sun, moon, or any other heavenly body. In the Old Testament, there are numerous references to the worship of the sun by various pagan cultures, and it is consistently condemned as idolatry.
One example of this can be found in Deuteronomy 4:19, which states: "And when you look up to the sky and see the sun, the moon and the stars—all the heavenly array—do not be enticed into bowing down to them and worshiping things the Lord your God has apportioned to all the nations under heaven."
Similarly, in 2 Kings 23:5, King Josiah of Judah is praised for removing the "idolatrous priests" who "burned incense to the sun, the moon, the constellations, and all the host of heaven."
Overall, the Bible teaches that the worship of any created thing, including the sun, is a violation of the commandment to worship God alone.