Chin up!
Although this also often applies to emotions (be happy, don't be so depressed and miserable); it also sometimes applies literally to a slouching posture, especially in the realms of dance and combat training.
There are more clear and literal ways of saying it (eg: back straight; don't slouch) but they're neither trendy nor metaphoric thus I don't think they qualify as idiomatic. I don't think there's any really popular English idioms that apply to this scenario.