We analyze the results of scanning near-field infrared spectroscopy performed on thin films of a-SiO2 on Si substrate. The measured near-field signal exhibits surface-phonon resonances whose strength has a strong thickness dependence in the range from 2 to 300 {nm}. These observations are compared with calculations in which the tip of the near-field infrared spectrometer is modeled either as a point dipole or an elongated spheroid. The latter model accounts for the antenna effect of the tip and gives a better agreement with the experiment. Possible applications of the near-field technique for depth profiling of layered nanostructures are discussed.