I've often had horrible nightmares during highly stressful times in my life. I even had disturbing sleepwalking incidents while experiencing the illness and death of a loved one. When I regained a more peaceful state of mind, the nightmares and sleepwalking stopped happening.
If you are experiencing alot of anxiety in your life, this may be causing you to have nightmares. If this is the case, and you feel like you cannot cope on your own, which is what I think caused my own bad sleep experiences, you could try talking over your problems with someone you can rely on for emotional support. I found this to be very helpful.