You are familiar with the relationship between flux and luminosity, right? This is usually taken as the definition of luminosity distance in extragalactic astronomy,
$$ F = \frac{L}{4\pi D_L^2}.$$
The quickest way to convert this into a relationship with spectral variables is to use differential 1-forms. So, $L \rightarrow L_\lambda \,\mathrm{d}\lambda_e$ and $F \rightarrow F_\lambda \,\mathrm{d}\lambda_o$, with $\lambda_e$ the photon wavelength at emission (also called the rest frame wavelength) and $\lambda_o$ the observed wavelength at $z=0$ (also called the comoving wavelength). Thus
\begin{align}
F_\lambda \,\mathrm{d}\lambda_o & = \frac{L_\lambda \,\mathrm{d}\lambda_e}{4\pi D_L^2} \Rightarrow\\
F_\lambda & = \frac{L_\lambda}{4\pi D_L^2} \times \frac{\mathrm{d}\lambda_e}{\mathrm{d}\lambda_o}.
\end{align}
Now you just need to take your derivative using the definition of redshift, $\lambda_o = (1+z)\lambda_e$, and use some way of calculating the luminosity distance in your cosmology.
Formally, a lot of people like to use $\nu F_\nu = \lambda F_\lambda$ as though it were a total flux, but it's not. The derivation will work, but only because redshifting scales all frequencies/wavelengths by a single constant. $\nu F_\nu$ isn't a measure of the flux under any part of the spectrum, it's a spectral flux using a different coordinate system. Consider the following
\begin{align}
F & = F_\nu \,\mathrm{d}\nu \\
&= \nu F_\nu \frac{\mathrm{d}\nu}{\nu} \\
&= F_{\ln \nu} \,\mathrm{d}\ln \nu.
\end{align}
In other words, $\nu F_\nu$ is still a spectral flux. If $F_\nu$ is in $\mathrm{ergs}\,\mathrm{cm}^{-2}\,\mathrm{Hz}^{-1}$ then $\nu F_\nu$ will be in $\mathrm{ergs}\,\mathrm{cm}^{-2}\,(e\text{-fold})^{-1}$. The $e\text{-fold}$ is a pseudo-unit, like radians, dex, octave, decibel, or magnitudes. In principle it can be omitted, just like how angular frequencies can be in radians per second, or just $\mathrm{s}^{-1}$.
Fun math exercise: show that $\ln(10) \nu F_\nu$ has units of $\mathrm{ergs}\,\mathrm{cm}^{-2}\,\mathrm{dex}^{-1}$.