Holistic approach. So to speak. When the first Icelandic horses were imported to Germany, more than half of them would get it. Took a long time to figure out why. First, Iceland has no gnats. Gnats bite, their saliva causes the itch. BUT..not all horses scratch themselves bloody....only the easy keeper type, ponies, Arabs, andalusians, some drafts....breeds who's origin is places without lush grass, who don't need much to keep going.
So a rather meager diet, low protein, low sugar, will help. Zinc an copper might have to be supplemented. Keep the horse stalled when gnats are active, dawn and dusk. Avon Skin-so-Soft bath oil "original", wiped on crest and tail, keeps the gnats away, but has to be done every day. I had two Arab mares who had literally no mane and tail when they arrived. I used the Avon and provided a dark run-in shelter and a year after they had beautiful manes and tails. Flax seed helps with skin and hair, provides omega fatty acids.
Gnats are still around in 40 degree temperature, so there is the reason for your itchy horse.