Konomineji, temple 27 on the Shikoku Pilgrimage is known as both nansho and a sekisho. a "nansho" is a temple that is considered difficult to reach, usually, as in the case of Konomineji,, because it is high on a mountain. Sekisho were barriers on highways that checked your papers. In terms of the pilgrimage they are 4 temples considered spiritual barriers that you will not get past without the correct spiritual attitude.
Nowadays the pilgrimage is considered Buddhist, but prior to the Meiji Period such a distinction was not made, with some of the pilgrimage sites being shrines and not temples. Konomineji was founded as both shrine and temple, with the shrine being above the temple. The shrine doesnt get as many visitors.
The temple burnt down in the early Meiji Period, and it was forbidden at that time to build a new temple so the locals found an unused temple in another part of the country and had it dismantled and reassembled here.
According to the legend the shrine and temple were founded by Gyoki in the eighth Century. The main deity is an 11-faced Kannon. It is now a Shingon temple.