It could be the start of a prostate issue. How long has it been going on?
You don't mention your age, but it can happen at any age. Certain problems are more common as you get older, but infections can occur at any age.
You'll need to see a doctor, of course. Is there a reason you haven't gone?
In the meantime, avoid alcohol and caffeine. Caffeine, especially, seems to aggravate it.