Nonlinear frequency conversion is a pathway to unlock undiscovered physics and implement tailored light sources for spectroscopy or medicine. A key challenge is the establishment of spectrally flat outputs, which is particularly demanding in the context of soliton-based light conversion at low pump energy. Here, we introduce the concept of controlling nonlinear frequency conversion by longitudinally varying resonances, allowing the shaping of soliton dynamics and achieving broadband spectra with substantial spectral flatness. Longitudinally varying resonances are realised by nanofilms with gradually changing thicknesses located on the core of an advanced microstructured fibre. Nanofilms with engineered thickness profiles are fabricated by tilted deposition, representing a waveguide-compatible approach to nano-fabrication, and inducing well-controlled resonances into the system, allowing unique dispersion control along the fibre length. Key features and dependencies are examined experimentally, showing improved bandwidth and spectral flatness via multiple dispersive wave generation and dispersion-assisted soliton Raman shifts while maintaining excellent pulse-to-pulse stability and coherence in simulations, suggesting the relevance of our findings for basic science as well as tailored light sources.