Righteous
Old English rihtwīs, from riht ‘right’ + wīs ‘manner, state, condition’. The change in the ending in the 16th century was due to association with words such as bounteous .
wiktionary
From earlier rightuous, rightwose, rightwos, rightwise, from Middle English rightwise, rightwis, from Old English rihtwīs(“righteous, just, right, justifiable”), corresponding to right + -wise (with assimilation of second element to -ous), or to right + wise(“way, manner”). Cognate with Scots richtwis(“righteous”), Old High German rehtwīsic(“righteous, just”), Icelandic réttvíss(“righteous, just”). Compare also thefteous, mighteous.
etymonline
righteous (adj.)
an early 16c. alteration of the older word, rightwise, which is from Old English rihtwis, of actions, "characterized by justice, morally right," of persons, "just, upright; sinless, conforming to divine law," from riht (see right (adj.1)) + wis "wise, way, manner" (see wise (adj.)). The alteration of the ending is by influence of courteous, etc. As a noun, "those who are righteous," Old English rehtwisan. The meaning "genuine, excellent" is 1942 in jazz slang. Related: Righteously.
Upright gets force from the idea of physical perpendicularity, a standing up straight by the standard of right ; righteous carries up the idea of right to the standards, motives, and sanctions of religion ; rightful applies not to conduct, but to claims by right : as, he is the rightful owner of the land ; just suggests by derivation a written law, but presumes that the law is a right one, or that there is above it, and if necessary overruling it, a law of God. This last is the uniform Biblical usage. Just generally implies the exercise of some power or authority. [Century Dictionary]