M.M.
Most antibiotics are considered safe while breastfeeding... so I'm more than a bit confused at your Dr's office stating they didn't know what to do.
Keflex is an L1 - Nursing compatibility from "Medications and Mother's Milk" by Dr. T Hale, 2008 Edition.
Simple infection (Mayo Clinic)
Drugs commonly recommended for simple urinary tract infections include:
Sulfamethoxazole-trimethoprim (Bactrim, Septra) ****L3* moderately safe****
Amoxicillin (Larotid, Moxatag, others) - ****L1* safest****
Nitrofurantoin (Furadantin, Macrodantin, Macrobid) ****L2* safe****
Ampicillin - ****L1* safest****
Ciprofloxacin (Cipro) ****L3* moderately safe - observe infant for diarrhea****
Levofloxacin (Levaquin) ****L3* moderately safe - observe infant for diarrhea****