Fungal eye infections are caused mainly by an eye injury and can result in serious eye damage. Fluconazole (FLZ), a broad-spectrum antifungal agent, is a poorly soluble drug with a risk of hepatotoxicity. This work aimed to investigate the antifungal activity, ocular irritation, and transport of FLZ-loaded poly (ε-caprolactone) nanoparticles using a rabbit eye model. Three formulation factors affecting the nanoparticle’s size, zeta potential, and entrapment efficiency were optimized utilizing the Box-Behnken design. Morphological characteristics and antifungal activity of the optimized nanoparticles were studied. The optimized nanoparticles were loaded into thermosensitive in situ hydrogel and hydroxypropylmethylcellulose (HPMC) hydrogel ophthalmic formulations. The rheological behavior, in vitro release and in vivo corneal transport were investigated. Results revealed that the percentage of poly (ε-caprolactone) in the nanoparticle matrix, polymer addition rate, and mixing speed significantly affected the particle size, zeta potential, and entrapment efficiency. The optimized nanoparticles were spherical in shape and show an average size of 145 nm, a zeta potential of −28.23 mV, and a FLZ entrapment efficiency of 98.2%. The antifungal activity of FLZ-loaded nanoparticles was significantly higher than the pure drug. The developed ophthalmic formulations exhibited a pseudoplastic flow, prolonged the drug release and were found to be non-irritating to the cornea. The prepared FLZ pegylated nanoparticles were able to reach the posterior eye segment without eye irritation. As a result, the developed thermosensitive in situ hydrogel formulation loaded with FLZ polymeric nanoparticles is a promising drug delivery strategy for treating deep fungal eye infections.