This English expression is most commonly used in spoken language in fairly informal settings and does not relate in any way to the weather but rather to a human condition.
The expression is used to denote that someone isn’t feeling very well. In general it is only used with minor illnesses or slight feelings of illness rather than serious conditions. It can also denote to a mental state and if someone is feeling a bit sad they may say that they are “feeling a bit under the weather.”
The earliest recorded use of this expression dates back to 1835 from The Jeffersonville Daily Evening News, which writes “I own Jessica is somewhat under the weather to-day, figuratively and literally,’ said the gentleman, amusedly, giving a glance at the lady over in the corner.” It is suggested that the expression has nautical origins from when sailors were out at sea and began to feel a bit seasick they would go down below deck, away from the weather, in order to recuperate.
An example of this expression can be found in Jarod Kintz’ book This Book is Not FOR SALE, which reads “I’m feeling a little under the weather. But once I open my umbrella, I’m sure I’ll begin to feel better.”