Alot of the remedies here are...interesting.
The bottom line is that fungii prefer non-acidic and moist environments in which to grow. Preventing and treating jock itch entails not just killing the fungii with an anti-fungal, but also making the affected less hospitable for the fungus in the first place. If you accomplish the first without the second, you're going to re-infect yourself.
I can't speak to diet and changes in diet -- I'm sure these have an impact, but it is foolish to generalize what works for one person, since each person's context is unique (given extant factors like body chemistry, medication, and illness).
Here are things that worked (for me) to cure a persistent jock-itch infection (which I picked up scuba diving in the Caribbean) that lasted six years:
(1) Trim the hair in the groin area. All of it, from the top of the pubic line to the...err...backdoor. Keep it trimmed until the infection is gone. If you're a super-hairy dude like me, all the hair can make it difficult to ensure the area is dry, and moisture encourages the growth and spread of the fungus. Note I said "trim" -- NOT SHAVE. Shaving can remove the top layers of skin, and make the infection worse by irritating the skin.
(2) Don't use antibacterial soaps or creams. Killing off the natural bacteria will eliminate the natural competitors (bacteria) to the fungii on the skin. Of course, if you have an open or weeping area, get to Urgent Care or your doctor. Cellulitis can result otherwise, and it sucks.
(3) Shower at least twice a day, washing the affected area with plain soap (like Ivory, Dove...just something without antibacterial agents). DO NOT SCRUB the area -- this can irritate the skin and make the infection worse.
(4) Blow dry the area after showering. Or air dry -- just make sure it's completely, completely dry after showering.
(5) Use a cream containing clotrimazole (see https://www.nlm.nih.gov/medlineplus/druginfo/meds/a682753.html) on the area after showering and drying. Again, allow this to dry completely before dressing.
(6) Use a light layer of powder containing clotrimazole after the cream has dried. This will help prevent the affected area from rubbing against your underwear and other skin, as well as help keep things dry. Apply the powder throughout the day.
(7) Wear loose-fitting clothes that let the skin of the affected area breathe. If you're lucky enough to work from home for most days of the week, forget pants and underwear altogether: fold a towel, sprinkle some powder on it, and plant your behind there. Change the towel every day.
(8) Don't wear underwear that rub on the affected area -- I had to switch to boxer briefs, as briefs rubbed and boxers allow my balls to rub against my thighs, which was not ideal.
(9) If you can't shower after being wet or sweaty, wipe the affected area gently with white vinegar or apple cider vinegar. Sometimes I used 1 part isopropyl/rubbing alcohol to three parts vinegar in this case. This cleans the surface of the skin, and makes it more acidic, which the fungii won't like. Let everything dry and reapply the cream and powder.
(10) Go to an Urgent Care or see your doctor. The oral treatments are not wonderful, and it's certainly not pleasant to have to drop trou in front of an attractive nurse, but that embarrassment pales in comparison when one considers the implications of being "that guy" who can't stop scratching his crotch.
(11) If you're SCUBA diving or partaking in some other activity in the water, take vinegar wipes and wipe yourself down as soon as you get out of the water. Even if you can't get dry, this will help with the itching.
And last: DON'T SCRATCH! This is the worst thing -- the relief is wonderful at first, but the infection will really kick with a vengeance afterward. Vinegar like described in #9 stopped the itching for me immediately. In a pinch, I've used apple cider vinegar, and even pickle juice.
Hope this helps someone. Jock itch sucks.