Integrated, monolithic nonlinear cavities are of great interest in both classical and quantum optics experiments due to their high efficiency and stability. However, a general analytic theory of classical three-wave mixing in such monolithic systems, including both linear and nonlinear regions with arbitrary finesse and non-zero propagation losses, is a challenging task. Here, we derive such a model for any three-wave mixing process (second harmonic, sum frequency and difference frequency generation) under the sole assumption of low single-pass conversion efficiency. We demonstrate remarkable agreement between the presented model and the experimentally obtained highly complex second-harmonic spectrum of a titanium-indiffused lithium niobate waveguide cavity that includes both a linear and nonlinear section. We then show the effect that reversing the linear and nonlinear regions has on the output spectrum, highlighting the importance of system design. Finally, we demonstrate that the model can be extended to include the effect of phase modulation applied to the cavity.