Due to their compact size and high sensitivity, plasmonic sensors have become a hot topic in the sensing field. A nanosensor structure, comprising the metal–insulator–metal (MIM) waveguide with a stub and a horizontal B-Type cavity, is designed as a refractive index sensor. The spectral characteristics of proposed structure are analyzed via the finite element method (FEM). The results show that there is a sharp Fano resonance profile, which is excited by a coupling between the MIM waveguide and the horizontal B-Type cavity. The normalized HZ field is affected by the difference value between the outer radii R1 and R2 of the semi-circle of the horizontal B-Type cavity greatly. The influence of every element of the whole system on sensing properties is discussed in depth. The sensitivity of the proposed structure can obtain 1548 nm/RIU (refractive index unit) with a figure of merit of 59. The proposed structure has potential in nanophotonic sensing applications.