We study the following problem: Given initial data on a compact Cauchy horizon, does there exist a unique solution to wave equations on the globally hyperbolic region? Our main results apply to any spacetime satisfying the null energy condition and containing a compact Cauchy horizon with surface gravity that can be normalised to a non-zero constant. Examples include the Misner spacetime and the Taub-NUT spacetime. We prove an energy estimate close to the Cauchy horizon for wave equations acting on sections of vector bundles. Using this estimate we prove that if a linear wave equation can be solved up to any order at the Cauchy horizon, then there exists a unique solution on the globally hyperbolic region. As a consequence, we prove several existence and uniqueness results for linear and non-linear wave equations without assuming analyticity or symmetry of the spacetime and without assuming that the generators close. We overcome in particular the essential remaining difficulty in proving that vacuum spacetimes with a compact Cauchy horizon with constant non-zero surface gravity necessarily admits a Killing vector field. This work is therefore related to the strong cosmic censorship conjecture.