better to use topical drugs only for vaginal infection
as absorption chances are less.
topical Chlorhexidine Gluconate
4 % solution is category B drug in pregnancy
means animal studies showed no adverse effects on fetus but human studies are lacking,
as you are almost near term so by this time all your fetal growth will be complete,
so you can use this as told by your doctor as benefits over weigh the risks here.