You might find this article interesting too: Vitamin D fights urinary tract infections.
“By inducing and activating cathelicidin with vitamin D, a local rather than a systemic effect can be achieved. This could offer selective and site-specific treatment of pathogens without perturbing commensal [friendly] microbes elsewhere in the body,”
I’ve read a lot of anecdotal evidence from people saying their recurrent UTIs cleared up after correcting their vitamin D status. A deficiency can mess you up in so many ways, yet it’s so common nowadays.