Quantum optical systems, like trapped ions, are routinely described by master equations. The purpose of this paper is to introduce a master equation for two-sided optical cavities with spontaneous photon emission. To do so, we use the same notion of photons as in linear optics scattering theory and consider a continuum of travelling-wave cavity photon modes. Our model predicts the same stationary state photon emission rates for the different sides of a laser-driven optical cavity as classical theories. Moreover, it predicts the same time evolution of the total cavity photon number as the standard standing-wave description in experiments with resonant and near-resonant laser driving. The proposed resonator Hamiltonian can be used, for example, to analyse coherent cavity-fiber networks [E. Kyoseva et al., New J. Phys. 14, 023023 (2012)].