I've had some trouble with this, following an iatrogenic bout of prostatitis (don't ask, you don't want to know! - but it was rather unpleasant).
For other reasons not directly related to the prostatitis per se, I have tried to follow a diet which is anti-inflammatory: minimize commercial seed oils (surprisingly difficult to totally eliminate - they're very sneaky!), in favor of animal fats, olive oil and coconut oil; and minimize easily assimilated carbohydrates (refined flours, sugars, etc. - I do currently eat some legumes, especially chick peas, in moderation). I eat very little fruit (from a cookery perspective, not a botanical perspective - I do eat tomatoes, curcubits, eggplant, etc.), and am even careful about how many carrots I eat. But, I do eat lots (and lots!) of leafy greens and cruciferous vegetables. Basically, I try to minimize blood sugar excursions, as a means of also limiting insulin spikes. I am not diabetic (though, in retrospect, I may have been exhibiting some early signs of insulin resistance before all of this started), but I am trying to reduce the potential for inflammation. I also take Vitamin D3 supplements (currently 10,000 IU daily) and K2 (100 micrograms daily); I am supplementing with oral D3 because I likely don't get enough sunshine to make my own (I try to stay out of the mid-day sun, since my mother died of malignant melanoma, and I have a lot of risk factors for melanoma, though all biopsies have been clean, just weird looking). I have also pretty rigorously limited my fluid intake after 9PM (a couple of hours before my bed time), and I make sure to empty my bladder good and well just before clambering into bed. I am also on a very low dose of tamsulosin; I'd like to try to wean myself off of that, but deep in the throes when this all began, it seemed necessary to keep the plumbing working. Having had multiple relapses of prostatitis, I have been hesitant to mess with it, since keeping urine moving, with good voiding, can't hurt, but the opposite certainly could.
Within the past few months (so, beginning a couple of years after the start of this whole escapade), I've experienced a marked improvement in how long I am able to sleep (once, recently, until 7:30AM - crazy!) and the number of night time trips (rarely more than one, anymore, unless it was a really hot day, and I have overcompensated on rehydration; sometimes zero trips per night, for two or three nights in a row - woohoo!). Most of the time, I am now sleeping until 5 or 5:30AM, sometimes until 6 or even 6:30, and even then, I may get coffee going and whatnot before I do what's necessary. I may even need to start setting a morning alarm again, something I haven't found necessary for several years. These days, if I do get up to make a trip, it's usually somewhere 2 and 3:30AM. Most often, the cat wakes me up, or the neighbor's lovelorn cat is yodeling, or one of the neighbors is making his way home from the local watering hole, or some kids who should be in bed are still out playing hide-n-seek or flashlight tag, and I figure "well, I don't know if it's really necessary, but I might as well go take care of it, since I'm already up". When this first started, I would be up - with urgency - 2 or 3 times per night on a good night, cat or no cat, and as many as 5 or 6 times on a bad night. Hard to get much good rest that way...
I can't guarantee that any or all of the above would help you. In point of fact, I'm not entirely certain what's helped me. But, I am going to keep doing what I have been doing, for the foreseeable future, since it seems to be helping in various facets of my health, not least fewer night time trips and better sleep.