  The resonant interaction between x-ray photons and nuclei is one of the most
exciting subjects of the burgeoning field of x-ray quantum optics. A
resourceful platform used so far are thin-film x-ray cavities with embedded
layers or M\"ossbauer nuclei such as $^{57}\mathrm{Fe}$. A new quantum optical
model based on the classical electromagnetic Green's function is developed to
investigate theoretically the nuclear response inside the x-ray cavity. The
model is versatile and provides an intuitive picture about the influence of the
cavity structure on the resulting spectra. We test its predictive powers with
the help of the semiclassical coherent scattering formalism simulations and
discuss our results for increasing complexity of layer structures.
