"You are not resting beside the big river, but under the tall tree."
Translation:Te nem a nagy folyó mellett pihensz, hanem a magas fa alatt.
"Nem" negates the word/phrase that's following it. So in itself "A nagy folyó mellett nem pihensz." is a correct sentence, meaning that resting is not what you are doing beside the river.
But the second clause "hanem a magas fa alatt" conrasts with the first one, and makes it clear that the location of the action has to be negated. So you have to put "nem" in front of the phrase "a nagy folyó mellett"
Since your first clause negates the verb, a second clause starting with "hanem" could only introduce another action that the subject is doing instead of resting: "A nagy folyó mellett nem pihensz, hanem olvasol."
I hope this is clear enough.