I have had some digestive problems since developing a haitus hernia a few years ago. I have found that along with what you eat, or don't, it is important to focus on when and how much you eat. Small portions are key and making sure you eat at least three hours before bed can help also. I try and make sure my stomach is empty before I go to bed.
Basically, a lot of it is trial and error. I also have learned that you want to keep the acid levels down in your system. Foods can be acidic or alkalyne and some can produce acid or alkalyne conditiions in your system. I suggest you educate yourself in how and what foods can do to your system. Here is a sample list/site that can get you started,The Acid/Alkaline Foods List
but there is tons of info on the net.
I have a hard time breaking old habits, and one of them is moderating my eating and drinking habits. I love very spicy food, and still eat it, but have reduced my intake. Alcahol, especially beer, seems to be the worst culprit in irritating my system, but I love the stuff. I have cut way back and feel a lot better for it.
Like I said, check out some sites, and find out for yourself what bugs your system. I would also keep a journal of what you eat daily, and if you have a flare up, you can go back and reference what you had to eat and maybe pinpoint what it was exactly that caused this. then, you can eliminate it totally, or figure out how to manage it with moderation or portion sizes.