The impact of the P/In flux ratio and the deposited thickness on the faceting of InP nanostructures selectively grown by molecular beam epitaxy (MBE) is reported. Homoepitaxial growth of InP is performed inside 200 nm wide stripe openings oriented either along a [110] or [1-10] azimuth in a 10 nm thick SiO2 film deposited on an InP(001) substrate. When varying the P/In flux ratio, no major shape differences are observed for [1-10]-oriented apertures. On the other hand, the InP nanostructure cross sections strongly evolve for [110]-oriented apertures for which (111)B facets are more prominent and (001) ones shrink for large P/In flux ratio values. These results show that the growth conditions allow tailoring the nanocrystal shape. They are discussed in the framework of the equilibrium crystal shape model using existing theoretical calculations of the surface energies of different low-index InP surfaces as a function of the phosphorus chemical potential, directly related to the P/In ratio. Experimental observations strongly suggest that the relative (111)A surface energy is probably smaller than the calculated value. We also discuss the evolution of the nanostructure shape with the InP-deposited thickness.