  By characterizing the contribution of stray light to large datasets from the
NuSTAR X-ray observatory collected over 2012--2017, we report a measurement of
the cosmic X-ray background in the 3--20 keV energy range. These data represent
$\sim20\%$ sky coverage while avoiding Galactic Ridge X-ray emission and are
less weighted by deep, survey fields than previous measurements with NuSTAR.
Images in narrow energy bands are stacked in detector space and spatially fit
with a model representing the stray light and uniform pattern expected from the
cosmic X-ray background and the instrumental background, respectively. We
establish baseline flux values from Earth-occulted data and validate the
fitting method on stray light observations of the Crab, which further serve to
calibrate the resulting spectra. We present independent spectra of the cosmic
X-ray background with the FPMA and FPMB detector arrays, which are in excellent
agreement with the canonical characterization by HEAO 1 and are $10\%$ lower
than most subsequent measurements; $F_{\rm{3-20~keV}}^{FPMA} = 2.63 \times
10^{-11}~\rm{erg~s^{-1}~cm^{-2}~deg^{-2}}$ and $F_{\rm{3-20~keV}}^{FPMB} = 2.58
\times 10^{-11}~\rm{erg~s^{-1}~cm^{-2}~deg^{-2}}$. We discuss these results in
light of previous measurements of the cosmic X-ray background and consider the
impact of systematic uncertainties on our spectra.
