Effects of solid nanolayers embedded in a near-critical density plasma on the laser-driven collisionless shock acceleration are investigated by using two-dimensional particle-in-cell simulations. Due to the interaction of nanolayers and the incident laser, an additional number of hot electrons are generated and an inhomogeneous magnetic field is induced. As a result, the collisionless shock is reinforced within the nanolayer gaps compared to the target without the structured nanolayers. When the laser intensity is 9.8 × 1019 W/cm2, the amplitude of the electrostatic field is increased by 30% and the shock velocity is increased from 0.079c to 0.091c, leading to an enhancement of the peak energy and the cutoff energy of accelerated protons, from 6.9 MeV to 9.1 MeV and 12.2 MeV to 20.0 MeV, respectively. Furthermore, the effects of the width of the nanolayer gaps are studied, by adjusting the gap width of nanolayers, and optimal nanolayer setups for collisionless shock acceleration can be acquired.