  The collective response of an atomic ensemble is shaped by its macroscopic
environment. We demonstrate this effect in the near-resonant transmission of
light through a thermal rubidium vapor confined in a planar nanocavity. Our
model reveals density-dependent line shifts and broadenings beyond continuous
electrodynamics models that oscillate with cavity width and have been observed
in recent experiments. We predict that the amplitudes of these oscillations can
be controlled by coatings that modify the cavity's Finesse.
