The X-ray nanofocusing techniques based on synchrotron radiation and free-electron laser facilities have become important ways to carry out cutting-edge scientific and technological research. Since the refractive indices of nanofocusing materials in X-ray regime are very close to unity, the X-ray focusing optics are very different from the traditional visible optics. The working principle of diffractive, refractive and reflective focusing optics commonly used in X-ray regime in the synchrotron field, and the development process of sub-micron to nano-scale focusing in recent years are introduced. When an X-ray focusing system approaches the diffraction limit, the wavefront distortion caused by the fabrication, mounting and collimation will seriously affect the final focusing performance of the system. Therefore, the related focused X-ray wavefront detection and manipulation play important roles as cutting-edge technologies and methods. In addition, the current main wavefront detection and manipulation techniques of the nanofocusing beam are introduced and compared, and the future development of X-ray diffraction-limited nanofocusing optics is also prospected.