The temple is filled with the fug of incense, the air musty with 400 years worth of prayers that have been offered up towards its wooden beams. I'm not a religious man, and certainly not one who prays to Chinese gods, but these are special circumstances. If it worked for pirates, it might work for me.

Outside, the tangy brine fills my nostrils and the unrelenting wind tugs at my hair. I stand at the threshold, the darkness of the temple behind me, the sea just a few blocks away, knowing that thousands of sailors have stood in this spot, like me, wishing the winds would back off a little.

From the Penghu Mazu Temple, the goddess of the sea, known as Tin Hau in Cantonese, has watched over this Taiwanese archipelago's seafarers for four centuries, offering her protection from countless typhoons like the one that is now darkening the skies.

I came to notoriously windy Penghu, an archipelago of 90 islands, to experience its maritime culture and soak in the folklore of pirates and conquering navies. Now I'm experiencing the uncertainty of being a Taiwan Strait sailor. Penghu's mariners learned long ago that the winds are out of their control, hence the 183 temples scattered across the islands, some large and grand, others so small and nondescript they're hard to find.

Severe Tropical Storm Fung-wong is churning her way north, aimed squarely at Taiwan. As soon as my flight touched down in Magong, the islands' main town, my skipper called to warn me that our sailing trip would be delayed.

Like any restless shore-bound sailor, I seek ways to kill time.

Magong is a maze of criss-crossing streets, the heart of the old town lying low and grey behind ancient walls, huddled against the elements. New, garish hotels and empty boulevards sit exposed to the steady rush of wind. The town's bars have been shut down for the season, and I haven't spotted any bordellos around the port, so I rent a scooter and ride the island's winding roads.

The reliance of the Penghu Islands, also known as the Pescadores, on the ocean is evident at every turn; from ancient houses and garden walls built of greying coral to the waft of drying fish.

SETTLEMENT OF these islands began some 700 years ago, 400 years before the Chinese arrived on the Taiwanese mainland, and they served as a way station for people migrating from Fujian province to Taiwan, leaving the chain scattered with historical sites.

Numerous navies have anchored off the Penghu shores, their colonial forces engulfing the islands and then receding again, like the storms that sweep over the low-lying land. The Dutch came to Taiwan in 1624, were challenged by the Spanish and were eventually dislodged by Ming-dynasty loyalist Zheng Chenggong, whose Latinised name was Koxinga.

He was a privateer with a vast fleet and control over large swathes of China's coastline, and the Penghu Islands were a frequent hideout. Koxinga used Taiwan as a base in his failed fight to overthrow the Qing dynasty and restore the Ming.

Eventually, the French came and built a fort overlooking Magong, but their stay was short, and they were long gone by the time the Japanese moved in for a 50-year stay, only to be replaced by the Chinese Nationalists.

Now it is the Republic of China's armed forces who are stationed on a far-flung promontory, their base built around the stately Yuwengdao Lighthouse, which was designed by a British engineer for the Chinese imperial government in 1828. Soldiers peer from behind rusted gates and banks of sagging sand bags, the camouflage paint on the buildings peeling in the sun. They slouch with boredom, staring across the strait at an ideological enemy that batters the island with tourists instead of artillery shells.

The islands have long been viewed as a frontline in tensions with mainland China, and martial law was only lifted in 1979, allowing people from Taiwan proper unfettered access for the first time. Penghu has since tried to grow a tourism industry, to prop up its tepid economy, offering as enticement its long, pristine beaches and azure water.

On July 23, Magong hit the front pages of newspapers when TransAsia Airways Flight 222, from Kaohsiung, crashed when landing in heavy winds and careened into nearby homes, killing all but 10 of its 58 passengers and crew.

"They were almost all from here, from Penghu, so it was very bad. Everyone knew someone affected," says my host, Tom Chen, proprietor of the oddly named 1,2,3 V-Stone B&B, which is located a short walk from the main harbour and a five-minute drive from the centre of Magong, in a rapidly developing part of town.

"Now everyone is scared, so with this storm there will be no flights or ferries until it is gone."

The snaking road that connects the islands via bridges and causeways leads to Wai-an, in Siyu township, a small village perched in front of a hill that threatens to push it into the sea. The village is centred on its port, the main street tracing a line of bollards on the wharf and each side street leading to and from the water.

The harbour is jammed with fishing boats, with more arriving every hour, seeking shelter from the impending storm. The boats appear first as dots on the horizon, riding a white wake as they draw near. They rumble into the port and tie up three deep along the wharf, where fishermen sleep in hammocks or squat on their haunches, cigarettes smouldering between their lips as they repair their nets.

"Looks bad, doesn't it," I ask a group of fishermen sitting on the wharf, surrounded by billowing heaps of net. They squint, looking up at the sky, where the sun still shines despite the dark bruise on the southern horizon.

"It will be over tomorrow," they assure me. "The storm comes one day and then it is gone."

The wind may prove inconvenient at times, but it does draw tourists to Penghu, whether for windsurfing, kite boarding or, more recently, sailing; the Penghu Regatta Week is held every June.

The fishermen were wrong, being out by two days, but finally the weather breaks, the wind dies and the skies clear.

We slip the lines on our 40-foot catamaran and motor to the harbour master's station, to officially clear port before heading out to sea. A stream of fishing boats floods out of the harbour alongside us, crews eager to lower their nets.

Soon we're making our way down the coast, where the ornate, curved roofs of the temples stand high above village houses. From the sea I can't be sure which of the temples venerate Mazu, so instead I mouth a prayer of thanks into the breeze, sure that it will eventually reach the goddess of the sea.