I have also had a lot of trouble sleeping this pregnancy. Getting up to pee 2-3 times a night doesn't help but I have trouble falling back asleep, it's like I am really restless or something. Unfortunately I don't have any advice but I can sympathize! It's strange though, I don't remember having this insomnia with my other 2 pregnancies.
I have been sleeping in a recliner since the end of the first trimester because I got a bad cold and then after that I couldn't breath out of my nose at night if I was laying down. I use breath rights to help with that, but elevating is essential. I think it would help with heartburn of course too. I also take sublingual b12 daily, which I have found helps me sleep well at night, but don't take it right before bed because it is also known for giving an energy boost. I take it during the day. I have also heard taking magnesium daily can help with sleep. As an added bonus it helps with preventing constipation too. When I tried to sleep in bed I'd just be up half the night, so I gave up on that idea.
I had terribly insomnia at the beginning of this pregnancy. One of the first signs I was pregnant. The sublingual b12 has fixed that. I forgot to take it for a couple weeks and the insomnia came back. I started taking it again and it went away. So, I'm sure.
I was having trouble sleeping due to some stomach pains waking me up around 3am each night. I wasn't calling it nausea because there was no sensation like gagging, but it was definitely uncomfortable like a sour stomach or even similar to the starting of an ulcer. Though it didn't feel like hunger I tried snacking when I woke up and that helped a little, because I assume I had excess stomach acid that needed to be put to use. After a few nights of this I tried a more substantial snack last night - a protein bar with 15 grams of whey protein - and that helped a lot. I got right back to sleep and stayed asleep until 7:20am without any aches or pains. Only drawback was some gassiness when I woke up but it wasn't painful so I don't mind.