We explore the influence of a temperature-dependent shear viscosity over entropy density ratio ηs/s on the azimuthal anisotropies v2 and v4 of hadrons at various rapidities. We find that in Au + Au collisions at full Relativistic Heavy Ion Collider energy, √ sNN = 200 GeV, the flow anisotropies are dominated by hadronic viscosity at all rapidities, whereas in Pb + Pb collisions at the Large Hadron Collider energy, √ sNN = 2760 GeV, the flow coefficients are affected by the viscosity in both the plasma and hadronic phases at midrapidity, but the further away from midrapidity, the more dominant the hadronic viscosity becomes. We find that the centrality and rapidity dependence of the elliptic and quadrangular flows can help to distinguish different parametrizations of (ηs/s)(T ). We also find that at midrapidity the flow harmonics are almost independent of the decoupling criterion, but show some sensitivity to the criterion at back-and forward rapidities.