I do know some techniques to deal with nightmares. One is just containment. You can do it either mentally or physically. Most people do it mentally, by imagining putting the images of the nightmare into any kind of container of your choosing--lock it in a safe, put it in a book on a high shelf, suck it up with a vacuum cleaner, etc. Or you can do it physically: get an actual container of any sort--a box, an envelope, a real safe, some tupperware, whatever--and write a description of the nightmare or draw it or depict it in any form you choose, put it mindfully into the container, seal it up, and put it somewhere out sight. It's supposed to get it out of your mind. It takes some practice to become really effective, but it works fairly well for me until I consciously bring it back up. You're not supposed to make it irretrievable by burning it or something like that, because that would be "stuffing" and is less effective. It's supposed to be just put away until you are in a place where you are ready to bring it out and deal with it, most often with your therapist. Containment isn't just for nightmares--it's for all sorts of thoughts, feelings, impulses, memories, etc. I use a big box I've decorated in a meaningful way that I keep shut with a metal chain and two combination locks.
Another technique, which is probably more effective, is called Image Rehearsal Therapy. You write down a vivid description of the beginning of your nightmare, but then you change the ending so that you come out victorious and it's less scary. Make it as visceral as possible. Then you reread it a few times throughout the day, trying to picture it in your head, especially the happier ending. It's supposed to actually make the nightmares go away as opposed to containment, which merely makes them less distressing to you throughout the day.
Google either of these for more information if you're interested. If you're going to google containment, try "containment skills for trauma" or "containment skills ptsd."