Optical gyroscopes measure the rate of rotation by exploiting a relativistic phenomenon known as the Sagnac effect. Such gyroscopes are great candidates for miniaturization onto nanophotonic platforms. However, the signal-to-noise ratio of optical gyroscopes is generally limited by thermal fluctuations, component drift and fabrication mismatch. Due to the comparatively weaker signal strength at the microscale, integrated nanophotonic optical gyroscopes have not been realized so far. Here, we demonstrate an all-integrated nanophotonic optical gyroscope by exploiting the reciprocity of passive optical networks to significantly reduce thermal fluctuations and mismatch. The proof-of-concept device is capable of detecting phase shifts 30 times smaller than state-of-the-art miniature fibre-optic gyroscopes, despite being 500 times smaller in size. Thus, our approach is capable of enhancing the performance of optical gyroscopes by one to two orders of magnitude.