Chin Up; Keep Your Chin Up

What does the idiom “Chin Up; Keep Your Chin Up” mean?

Definition:

Cheer up; try to be cheerful and strong

For example:

“It’s too bad you didn’t get the job, but keep your chin up—another one will come along.”