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]