Two women, their heads covered, bend to walk through the low archway. Their steps are carefully measured: they have to step through with the right foot, and walk out with the left. As with all visitors to Səkkiz Qapı, they repeat this procedure eight times, one for each of the eight arches of this shrine in Mashtagha, a settlement about 30 kilometers north of Baku.

Shrines like Səkkiz Qapı have an enduring popular appeal in Azerbaijan, partly due to their informal status. There are few criteria to define them – location, whether in towns, cities, or the countryside, does not matter. Physically, they can be elaborate building complexes, piles of rocks or simply a ribbon on a tree. What matters is their spiritual significance – and popular belief in their healing powers.

These shrines combine Islamic beliefs with devotion to local “righteous men” and their burial sites. They have a long history in the country, a source of continuity amidst the different faiths that have washed over the Caucasus, from Zoroastrianism to Judaism to Christianity to Islam as well as the atheism imposed by the USSR. Although no official list exists, there are reportedly hundreds of them in this ostensibly secular republic – and they appear to be thriving.

Veneration of holy men is an important feature of Shi’a Islam, which is followed by roughly 65 percent of the country’s population. To religious scholars, those claims say more about people’s identities than their religious observance. A relatively small proportion of the population attends mosques on a regular basis; the rest identify themselves as Muslim, but their knowledge of theology and ritual is thin.

That is largely a result of communism. In the Soviet Union, the state cracked down heavily on organized religion, targeting mosques, churches and synagogues alike. As Bruce Grant, a professor of anthropology at New York University who has studied shrines in Azerbaijan, has written, “over the entire Soviet period, the number of functioning mosques in the predominantly Muslim republic went from approximately two thousand to two dozen.” Inevitably, religious knowledge declined.

Paradoxically, the popularity of shrines in Azerbaijan today owes something to that crackdown. In the absence of organized religion, visiting shrines in the USSR became one way for people to cling to some element of their faith and assert their independence from the state.

The government’s present-day efforts to combat religious extremism in this majority-Shi’a country may also be a factor. Building mosques or going on the hajj, theIslamic pilgrimage to Mecca, the holiest city for Muslims, are difficult for ordinary Azerbaijanis because of the bureaucratic hurdles erected by the state. In that context, visiting shrines offers a much easier alternative.

When speaking about religions, it is easy to divide believers into different categories, but shrines in Azerbaijan – as elsewhere – often defy such rigid division, blending elements of Sunni and Shi’a Islam, local beliefs and even Christianity.

But that is of little consequence to the women in Səkkiz Qapı. After they cross the last threshold, the guide hits the iron plate above. The noise startles visitors and is supposed to frighten away their worries.

Located in the village of Buzovna, on the Absheron peninsula, the "Ali ayağı" (Ali’s footprint in the Azerbaijani language) sanctuary dates back to the 17th century.

An image of Imam Ali, Prophet Mohammad’s cousin and brother-in-law who Muslim Shi’ites consider the first imam. Legend has it that one of Buzovna’s elders dreamed that Imam Ali visited the village on his horse. Once awake, the old man went to the place he saw in his dream and found traces of Imam Ali’s presence. A shrine was built on that exact spot and it has attracted thousands of pilgrims ever since.

Pilgrims inside the shrine. People come hoping for help to heal diseases or to achieve life goals.

An old woman kisses the Quran inside the shrine. At the back is a painting of the Imam Ali Mosque of Najaf, Iraq, which is considered the third holiest islamic site by Shi’ites.

Inside the shrine, the footprint believed to have been made by Imam Ali, is protected by glass.

A man indicates the mark hat pilgrims believe was left by Imam Ali’s horse.

Worshippers pray in front of the image of Imam Ali Mosque of Najaf.

In Mashtagha, a settlement about 30 kilometers north of Baku, there is the Səkkiz Qapı, which means "Eight Doors" in the Azerbaijani language.

It is believed that if a person has a wish, it will come true if they walk through each of the eight doors.

Each of its eight sides has a door with a number on it. According to tradition, the shrine was built by a local woman called Pari, and today the shrine has a healer performing the çıldaq, a traditional healing method that involves burning a tissue and applying it to specific nerves.

The guide explains to the visitors that they have to walk into each of the arcs leading with their right foot and walk out leading with their left foot.

When a visitor walks through the last door, the guide hits the iron plate above the arc. The noise is believed to cause surprise and eliminate fear.

Around the Səkkiz Qapı there are about 15 graves of Seyids. They are Muslims claiming to descent from Muhammad, specifically through Husayn, the prophet's younger grandson.

The image of Imam Ali and Seyid Ibad Agha hang side by side in the shrine dedicated to the Seyid Ibad Agha, located in the Mashtagha settlement.

Seyid Ibad Agha was born in 1900 in Mashtagha where he lived all his life. He was highly regarded by the local community and people still respect him decades after his 1972 death.

A photo of Seyid Ibad Agha inside the shrine. Often believers carry his photo in their homes, cars and other visible places.

A man prays in front of the Pirsaat Baba shrine, on the Baku-Shamakhi highway, near the river Pirsaat. This spot has been considered sacred since the 15th century, yet excavations have not found any traces of places of worship. In 1993 private donations provided the needed funds to build the shrine.

According to legend, a man dreamed that a terrible earthquake would hit the area but when he warned the local community, no one believed him. An earthquake eventually occurred and killed many people. Sometime after his dream the man left the village and settled on the spot where the shrine is now located. Locals began visiting the man, claiming he had healing powers.

The core of Pirsaat Baba, literally Pirsaat’s Grandfather, is a small square area made of stone. Inside there are three graves, but there is no information about who is buried there.

Flowers at the shrine of Pirsaat Baba in Shamaki.

A bowl and stones at Pirsaat Baba. In some shrines people leave cash donations.