If using fresh spinach, briefly wilt it. If using frozen spinach, thaw it. In both cases, it is crucial to thoroughly squeeze out all excess liquid – otherwise the pastry will get soggy.
Sauté the onion in olive oil until translucent. Let it cool.
In a large bowl, mix the squeezed spinach, sautéed onion, crumbled Feta cheese, eggs, dill, parsley, nutmeg, and black pepper. Add salt sparingly, as Feta is salty.
Unroll the Filo pastry and cover it with a slightly damp cloth to prevent it from drying out. Melt the butter.
Preheat the oven to 185 °C (365 °F). Prepare a baking pan (approx. 25x35 cm) and grease it.
Place the first sheet of Filo pastry on the baking pan. Brush it with melted butter (or oil) using a pastry brush. Repeat the process until you have used about half of all the sheets (usually 6–8 layers).
Spread the spinach-Feta filling evenly, making sure it reaches the corners.
Place the remaining Filo sheets on top, again brushing each with butter/oil.
Using a sharp knife, score the pie into portions (squares or triangles). It is important to score before baking, otherwise the crispy pastry will shatter.
Bake for 40-50 minutes at 185 °C (365 °F) until the Spanakopita is golden brown and the pastry is crispy.
Allow to cool for 10-15 minutes before serving to let the filling set.