Measurements are presented of the single-diffractive dijet cross section and the diffractive cross section as a function of the proton fractional momentum loss $\xi$ and the four-momentum transfer squared $t$. Both processes pp$\to$pX and pp$\to$Xp, ie with the proton scattering to either side of the interaction point, are measured, where X includes at least two jets; the results of the two processes are averaged. The analyses are based on data collected simultaneously with the CMS and TOTEM detectors at the LHC in proton-proton collisions at $\sqrt{s}$= 8 TeV during a dedicated run with $\beta^{\ast} =$ 90 m at low instantaneous luminosity and correspond to an integrated luminosity of 37.5 nb$^{-1}$. The single-diffractive dijet cross section $\sigma^\mathrm{pX}_{\mathrm{jj}}$, in the kinematic region $\xi \lt$ 0.1, 0.03 $\lt |$t$| \lt 1$ GeV$^2$, with at least two jets with transverse momentum $p_\mathrm{T} >$ 40 GeV, and pseudorapidity $|\eta| \lt$ 4.4, is 21.7$\pm$0.9 (stat)$^{+3.0}_{-3.3}$ (syst) $\pm$ 0.9 (lum) nb. The ratio of the single-diffractive to inclusive dijet yields, normalised per unit of $\xi$, is presented as a function of $x$, the longitudinal momentum fraction of the proton carried by the struck parton. The ratio in the kinematic region defined above, for $x$ values in the range $-$2.9 $\leq \log_{10} x \leq$$-$1.6, is $R = (\sigma^\mathrm{pX}_{\mathrm{jj}}/\Delta\xi)/\sigma_{\mathrm{jj}} =$ 0.025$\pm$0.001 (stat) $\pm$ 0.003 (syst), where $\sigma^\mathrm{pX}_{\mathrm{jj}}$ and $\sigma_{\mathrm{jj}}$ are the single-diffractive and inclusive dijet cross sections, respectively. The results are compared with predictions from models of diffractive and nondiffractive interactions. Monte Carlo predictions based on the HERA diffractive parton distribution functions agree well with the data when corrected for the effect of soft rescattering between the spectator partons.