"And it came to pass when Adoni-Zedek king of Jerusalem heard" (Joshua 10:1). This place makes its inhabitants righteous: Adoni-Zedek ["my lord is righteousness"] and Melchizedek ["king of righteousness"]. Jerusalem is called "righteousness" ["tzedek"], after "righteousness lodged in her" (Isaiah 1:21).
Jerusalem the City That Makes Its Dwellers Righteous
Yalkut Shimoni on Nach 19:5
ויהי כשמוע אדוני צדק מלך ירושלים (יהושע י, א) המקום הזה מצדיק את יושביו אדוני צדק ומלכי צדק נקראת ירשלים צדק ע"ש צדק ילין בה.