Nanoposts of 10-40 nm top diameter on an InGaN/GaN quantum well structure were fabricated using electron-beam lithography and inductively coupled plasma reactive ion etching. Significant blue shifts up to 130 meV in the photoluminescence (PL) spectrum were observed. The blue-shift range increases with decreasing post diameter. For nanoposts with significant strain relaxation, the PL spectral peak position becomes less sensitive to carrier screening. On the basis of the temperature-dependent PL and time-resolved PL measurements and a numerical calculation of the effect of quantum confinement, we conclude that the optical behaviours of the nanoposts are mainly controlled by the combined effect of 3D quantum confinement and strain relaxation.