Ocular drug delivery presents significant challenges, attributed to the various anatomical and physiological barriers, as well as the limitations associated with conventional ocular formulations including low bioavailability, necessitating frequent dosing. The objective of the essay was to design sustained release nanofibrous inserts loaded with ceftazidime (CAZ), an antibiotic effective against gram-negative and gram-positive microorganisms, for the treatment of ocular infections. These nanofibers were fabricated using the electrospinning technique, employing biodegradable polymers such as polyvinyl alcohol (PVA), polycaprolactone (PCL) and Eudragit® (EUD). The nanofibrous inserts exhibited adequate mechanical strength for ocular use with an average diameter < 250 nm. In the initial 12-h period, a burst drug release was observed, followed by a controlled release for 120 h. Cell viability test confirmed the non-toxicity and safety of the nanofibers. The in vivo study demonstrated that the inserts sustain a drug concentration exceeding the minimum inhibitory concentration (MIC) of Pseudomonas aeruginosa and Staphylococcus aureus for 4 and 5 days, respectively. The AUC0–120 for CAZ-PVA-PCL was reported 11,882.81 ± 80.5 μg·h/mL and for CAZ-PVA-EUD was 9649.39 ± 86.84 μg·h/mL. The nanofibrous inserts' extended drug release maintains effective antimicrobial concentrations, avoids the fluctuations of eye drops, and, by being preservative-free, eliminates cytotoxicity.