If Buddhism is about moderation, then why is it that you can attain nirvana only after renouncing worldly possessions? This is really confusing to me. Buddha himself was an ascetic, and his teachings seem to imply that the path to nirvana is attained through renouncing one's worldly possessions. 

Isn't this in direct contradiction to the Middle Way?
These are common misunderstandings of the middle way. The middle way is best explained through the Buddha's life story. 

The Buddha began as a nobleman who had the money for all the indulgence in sensual pleasures which he wanted. However, indulgence in pleasure did not lead to lasting happiness. This is the first extreme. The Buddha then became an ascetic who starved himself and took part in self mortification. This was an attempt at gaining happiness through pain, or indulgence in pain. This is the second extreme and it did not lead to lasting happiness.

The middle way is neither indulgence in pleasure nor indulgence in pain. The middle way is not about moderation, it is about the attitude to indulgence. 

Taking a simple example like eating chocolate: There are extremes of never eating chocolate or eating 10 bars of chocolate each day, but eating in moderation such as 1 bar per day is not going to bring about happiness. If you eat 1 bar of chocolate and you treat it as the best thing you've ever tasted then you're already indulging in pleasure. The amount of chocolate is irrelevant. The point is to eat chocolate without doing it to seek pleasure and without doing it to seek pain.

One final common misconception which you didn't mention is "The middle way is for laypeople, monks don't follow the middle way". This misconception comes from the idea that the middle way is moderation. Although monks deny themselves things like sex or perfume this is not a type of indulgence in pain, the purpose of the rules is entirely different. The monks don't try to use perfume in moderation but as I've explained moderation is not the middle way.