We study spontaneous emission of an atom near a nanofiber with two
fiber-Bragg-grating (FBG) mirrors. We show that the coupling between the atom
and the guided modes of the nanofiber can be significantly enhanced by the FBG
cavity even when the cavity finesse is moderate. We find that, when the fiber
radius is 200 nm and the cavity finesse is about 30, up to 94% of spontaneous
emission from the atom can be channeled into the guided modes in the
overdamped-cavity regime. We show numerically and analytically that vacuum Rabi
oscillations and strong coupling can occur in the FBG cavity even when the
cavity finesse is moderate (about 30) and the cavity length is large (on the
order of 10 cm to 1 m), unlike the case of planar and curved Fabry-Perot
cavities.