In this work, we demonstrate the direct measurement of the strain state at the surface of nanostructures by in-plane X-ray diffraction. GaN tapered nanopillars have been fabricated by dry etching of a highly strained epilayer. The strain of the surface as function of pillar height shows an exponential relaxation which can be described by a single relaxation parameter. Additionally, we have simulated the strain relaxation and distribution of nanopillars. The impact of the pillar geometry on the strain relaxation has been discussed. In agreement with the measurements, an exponential relaxation of the strain is observed.