Periodic pinning effects in indented Nb films and Nb films with rectangular arrays of submicrometric Ni dots were studied. The indented samples consisted of Nb film deposited on top of Si substrates patterned with rectangular arrays of nanoholes. Pinning effects can be observed in the evolution of resistivity and critical current with the applied magnetic field, showing the same qualitative behavior, for both types of samples. The main difference between them is that the matching effects are more pronounced in the samples with magnetic dots. The analysis and comparison of these results allows determining the pinning as due to superconductivity suppression around the nanostructures (indentations or dots) due to a thickness reduction. For the samples with magnetic dots, this suppression of superconductivity is reinforced by the magnetic proximity effect.