From 《五灯会元》 (Song dynasty Chan Buddhist text): '汝等诸人,个个顶天立地' — 'each of you supports heaven and stands on earth'. Later reinforced by Yuan drama 《赵氏孤儿》: '我韩厥是一个顶天立地的男儿'.
usage
Almost always describes a person of principle — most often 男子汉 ('a real man'), 英雄, or 大丈夫. Rarely applied to women; a modern genderless alternative is 堂堂正正.