Before reaching the temple itself, the first structure that looms into view is actually the roofed gate of the original outer walls:
And to its right, a stone marker inscribed with 開山王廟 or Temple of King Kai-Shan also can be seen:Both 開山王 and 延平郡王 refer to the one and only Koxinga國姓爺, i.e., 鄭成功 [Cheng Chen-Gong], who recovered Taiwan from the Dutch in 1661-2.
Soon after Koxinga's death in 1662, a small shrine was built on this site to memorialize him. In 1683, the Qing defeated Ming-Cheng. To avoid anti-Qing popular uprising in the name of Koxinga, his tomb was relocated to Nan-An, his hometown in Hokkien. The worship of Koxinga nonetheless continued unabated, and this shrine and all other similar ones in Taiwan were named 開山王廟 to avoid trouble since Koxinga was still regarded as a historical archenemy of the Qing state. 開山, literally mountain-opening or trail-blazing, was a hidden reference to Koxinga as the first legitimate ruler of Taiwan. It was not until 1874 when Imperial Commissioner 沈葆楨 Shen Bao-Zen, recognizing the popular sentiment, petitioned the Qing Court to rehabilitate Koxinga instead as a national hero who drove the Dutch out of Taiwan. This was at a time when foreign powers came to invade China and the success of Koxinga was cited as an example to inspire the populace. Shen's request was granted, Koxinga was even promoted from 延平王 to 延平郡王 [some sources claim that this was to conform to the Qing nobleman ranking system rather than a promotion], and enshrined in an officially-sanctioned temple built in 1875 on the same site in Tainan.
This was the front gate 三川門 leading into the courtyard of the temple:
And the Hokkien-style temple itself is shown below [picture was taken during the Japanese era, hence the two out-of-place ishidoros]:
When Taiwan was ceded to Japan in 1895, this temple was preserved and re-named 開山神社 to demonstrate the Japanese affinity toward Koxinga - because his mother was Japanese, and to placate the Taiwanese. In 1914, a worship pavilion and other accessory buildings were also added (with a traditional Japanese torii planted outside of the main gate):
[The worship pavilion in the courtyard. Source: http://taipics.com, under Cities-Tainan-Japanese shrine]
After the KMT takeover of Taiwan in 1945, most Japanese jinjas were either destroyed or altered, the Koxinga Shrine/Jinja was no exception. The temple itself was saved although the Japanese structures were all removed and the temple name 延平郡王祠 restored. This time, Koxinga became a national hero again, credited for his efforts in trying to recover mainland China for the Ming while his Japanese heritage was downplayed at the same time.
In 1963, the old Hokkien-style temple was demolished and replaced with a Chinese palace-style building constructed with concrete and steel:
And a sculpture of Koxinga by a modern-day Taiwanese artist Mr Yang Yin-Feng was installed [the original statue remains at the Cheng Family Temple]:
The Japanese torii was also modified into a Chinese-style monument complete with a KMT emblem:
And the horizontal portion of the original Japanese torii has been recovered and is now kind of on display in an obscure corner on the temple grounds:
Over a span of 300 years, the Koxinga Temple has gone through four iterations - a reflection of not only the times but also the politics.
Needless to say, whichever way the wind blows, exploitation or otherwise, Koxinga will always remain a folk hero to the Taiwanese.