01 - Preheat the oven to 400°F. Line a baking sheet with parchment paper.
02 - Cut the spaghetti squash in half lengthwise and scoop out the seeds. Drizzle the cut sides with 1 tablespoon olive oil and sprinkle with salt and pepper.
03 - Place the squash halves cut-side down on the prepared baking sheet. Roast for 35 to 40 minutes, until the flesh is tender and easily shredded with a fork.
04 - While the squash is roasting, heat the remaining 1 tablespoon olive oil and the butter in a skillet over medium heat. Add the onion and cook until soft and translucent, about 5 minutes. Add the garlic and cook for 1 minute more.
05 - Remove the squash from the oven. Allow to cool slightly, then use a fork to scrape the flesh into spaghetti-like strands. Place the strands in a large mixing bowl.
06 - Add the cooked onion and garlic, sour cream, milk, half the Gruyère, half the Parmesan, nutmeg, salt, and pepper to the bowl. Mix until well combined.
07 - Transfer the mixture to a greased 2-quart baking dish. Top with the remaining Gruyère and Parmesan.
08 - Reduce oven temperature to 375°F. Bake for 20 to 25 minutes, until the top is golden and bubbly.
09 - Garnish with chopped parsley before serving, if desired.