Rama worships Shiva as a linga on the island of Rameswaram — before the bridge in the Ramayana, or after Ravana's death to expiate the killing of a brahmin in temple tradition, where Sita's sand linga and Hanuman's linga from Kailasa stand side by side.
The textual layer has Rama, before building his bridge to Lanka, tell Sita how Shiva appeared and was worshipped as a linga on the island; the Skanda Purana's Setu section and the Shiva Purana have him propitiate Shiva with mantras, meditation and dance, receive the promise of victory over Ravana, and ask Shiva to stay on the island to sanctify the world.
What is different here:
Base telling: worship precedes the war; no sand linga, no Hanuman errand.
The temple's own story places the worship after the war. Having killed Ravana, a brahmin and a Shiva devotee, Rama is told to expiate the killing by worshipping Shiva, and sends Hanuman to Kailasa for a linga. When the auspicious hour draws near and Hanuman has not returned, Sita shapes a linga of sand, the Ramalinga, and it is consecrated. Hanuman's linga, the Vishwalinga, is installed beside it and, to console him, is worshipped first to this day. The shrine counts among the twelve Jyotirlingas and the Tamil Paadal Petra Sthalams.
What is different here:
Worship follows Ravana's death as expiation; adds Sita's sand linga, Hanuman's Kailasa linga and the order of worship.
South India · Chilumuru and Iluru on the Krishna, Andhra PradeshShaiva
On the banks of the Krishna the same story is told of two shrines facing each other. Rama, returning north, installs lingas as he goes; Sita's linga of sand keeps growing until she caps it with a knot of sand, and Hanuman's linga from Kailasa is set on the opposite bank. The Skanda Purana is cited as the authority.
What is different here:
Relocates the episode to the Krishna river on the return journey; the sand linga grows and must be capped.