Melt the butter in a medium saucepan over medium heat. Whisk in the flour and cook, stirring constantly, for about 3 minutes.
Gradually add the milk, whisking until smooth. Cook, stirring, until the sauce thickens.
Season lightly with salt and pepper. Remove from the heat and whisk in the Dijon and nutmeg. The béchamel keeps up to a week.
Preheat the oven to 425°F with a rack in the upper-middle position. Line a baking sheet with parchment paper.
Spread a thin layer of béchamel on one side of each bread slice, all the way to the edges.
Place 4 slices, béchamel side up, on the baking sheet. Top each with 2 slices of ham, about ¼ Cup of the Gruyère and a sprinkle of Parmesan.
Cover with the remaining bread, béchamel side up, and top with the rest of the Gruyère and Parmesan.
Bake for 5 to 6 minutes, until the cheese melts.
Switch the oven to broil and broil until the top is lightly golden, 2 to 4 minutes. Watch closely.
For a croque madame, fry 4 eggs sunny side up while the sandwiches broil, season with salt and pepper, and set one on each sandwich.