This might be extreme but I used to suffer terribly with this too, pool and open water. For other reasons I had a food intolerance test done and found I was highly 'reactive' to dairy. Knocked dairy on the head and my main complaint has disappeared but I'm also sleeping better, snoring less and not getting bunged up from swimming. But a £3 nose clip is a cheaper and equally effective option!
I started using a nose plug for OW and have not had a problem since. I don't need to use one in the pool. It takes a little getting used to switching back and forth between using the plug and not using it, but so worth it.