The phrase ‘under the weather’ is an example of an idiom. We’ve all used the phrase without knowing where it came from.
If you think about it, the phrase “under the weather” shouldn’t make sense. Unless you’re an astronaut orbiting the earth, you’re always under the weather.
The weather is up in the sky. Since the weather is over our heads, we’re all under the weather. But that’s the thing about idioms. An idiom is a phrase that carries a meaning  that may not always be discernible at its face value.
Once you know the idiom’s true meaning, I suppose you don’t care too much about how much or how little sense it makes. The speaker (or writer) communicated the idea.
I hope you’d agree that this is the primary point of our language, right?
You probably already know what the phrase means. Someone who feels ill or generally unwell could be so described. Some sources say you can use the phrase to describe someone suffering from a hangover. (I don’t recall ever hearing it used this way, but it seems like it could be fairly easily.)
But it can also be used to refer to someone who is just feeling a bit down. One doesn’t have to experience poor physical health. One can be described that way if they’re experiencing poor mental health as well.
The fall is the time of year, for example, when seasonal affective disorder, or SAD, strikes. It’s a time of year when the days get shorter. You feel less sunlight, more darkness. That can affect your mood.
So you can feel fine physically but still be “under the weather.”
The phrase seems to have originated with sailors.
Other than the obvious relation to how sunshine or rain might affect one’s mood, the phrase may date back to old sailing ships.
Some believe the phrase originally began as “under the weather bow.” That leads to an obvious question: What’s a weather bow?
My dad loves sailing, and I’m sure he could give you a detailed explanation of the phrase. I’ll spare you such a lengthy explanation.
You’re welcome!
The weather bow, in nautical terms, refers to the side of the ship facing the prevailing winds. Rough waters and rough weather could make a sailor seasick. Someone adversely affected by bad weather might go below decks, and, thereby, under that bow.
You would go there after you felt ill. So eventually, the phrase came to mean someone who was feeling unwell.
Then, eventually, the word bow just disappeared.
That left the phrase we use today intact, even if most people have never heard the sailing theory.