In nonlinear frequency conversion, light at one frequency co-propagates with the generated light at the harmonic frequency. Previous experimental and theoretical work on second-harmonic generation in cavities has largely focused on cavities with a single resonant mode at the pump frequency. Such structures require high input power. Second-harmonic generation in a doubly resonant cavity, with a resonance at both the pump and harmonic frequency, has previously been analyzed only in the limit where nonlinear down-conversion can be neglected. Previous work on third-harmonic generation in cavities, similarly, considered only singly resonant cavities; moreover, past work focused on the case of χ(2) materials where 3ω is generated by cascading two nonlinear processes (harmonic generation and frequency summing). Furthermore, the previous theoretical work, with a few exception, focused on one-dimensional Fabry-Perot cavity geometries, in which the problem of obtaining cavity modes with the correct frequency ratio was posed as a problem of phase-matching, and addressed by methods such as using off-normal beams.