The phrase under the weather, meaning to be ill is commonly thought to be of nautical origin. Mariners are concerned with weather and to be beneath a storm is not a pleasant prospect. A slightly different nautical explanation of the origin of the phrase is a clipping of under the weather bow, the weather bow being the side of a ship's bow that is taking the brunt of rough seas. But neither explanation holds up under scrutiny.
Instead, this phrase is an Americanism that dates to 1827. The contexts of early citations are not nautical at all. The phrase probably comes from the idea that the weather can affect one mood and health.