My first child had awful digestive issues . . . gas, constipation followed by severe diarrhea. At one point, he had to have a barium enema after a midnight ER run. Nothing was physically wrong with him, is what my doctor said. They told me he was colicky and it would pass. Noone ever mentioned allergies to me. In desperation, I tried some milk-based formula and he immediately broke out in hives, just from the bit that touched his face. I weaned him at 6 months and put him on soy formula. He was a completely different kid, happy, pooping normally, sleeping through the night. At 12 months, we took him to a pediatric allergist for allergy testing. They found him to be allergic to all dairy products, eggs and peanuts. While I wasn't surprised, since we suspected it, I was angry that his doctor never thought this was a possibility. The thing is though, even if we had suspected allergies, I doubt I would have figured out the milk, eggs and peanut without an allergist. You may consider doing the skin-prick allergy testing. It's not fun for the child, and your Dr. may discourage it at such a young age, I don't know. I consider it a life saver for my child, since we had no idea he was allergic to peanuts (which is an analphylactic reaction for him). My son is now 5 years old. After avoiding dairy and eggs for 2 years, he was negative for those allergies at age 3. Now we only have the peanut allergy left (the most dangerous and least likely to outgrow)
Anyway, you could try an elimination diet. You can get info. online, some even have charts of which foods to start with. (I'd do a search on "Breastfeeding elimination diet"). There are a few ways to do it, but you can basically take everything out of your diet except for those least likely to offend (e.g. chicken, veggies (but not gassy ones like broccoli). If he's doing great with just that, add something like dairy and see what happens. Don't add a bunch of things at once or you won't know what the offending food is. And write everything down so you remember what you ate and how it affects him.
That being said, it's OK if it doesn't work out. This is difficult and stressful to figure out and in the end it may not be "worth it" (I say that carefully, because breastfeeding is so healthy for our babies, but I also believe the whole family needs to be healthy). When I had my second child, she didn't seem to have any allergies, and I thought "finally, I can nurse a child as long as I want to/she needs to". When she was 4 months old, I was at doctor after doctor for a suspected muscle disease, and needed massive amounts of sleep. The best thing for my family was to wean her, so that my husband could feed her often. I was honestly too exhausted to even pump. I felt like my body wasn't even able to take care of itself, let alone provide nutrients for a baby. As soon as I quit nursing, I had a bad muscle flare-up (skeletal muscles were actually damaged), had difficulty walking, but within weeks, things subsided and I while I will likely never be back to normal, I function fine, and was never diagnosed with anything (I still believe it was related to hormones). My point is that it didn't work out for us and that's OK. I can be criticized by breast-feeding advocates, but it doesn't change the fact that it did not work out for us in a very serious way. My daughter is healthy and well-adjusted socially and emotionally.
Also, if you don't agree with your doctor (you can like him and still not agree with him!), find a different one, if you can. I realize sometimes insurance and location doesn't allow this, but if it's a concern and an option, find somone else!
I am now pregnant with #3 and am already "scared" about breastfeeding. I will do everything I can and I really hope it works out. But, if it doesn't, it's not the end of the world, and I haven't failed as a parent!
Blessings to you!