Preheat your oven to 350°F (175°C).
Grease a 9x13-inch baking pan with coconut oil or butter.
In a large mixing bowl, whisk together the dry ingredients: gluten-free all-purpose flour, baking soda, baking powder, ground ginger, ground cinnamon, ground nutmeg, and salt.
In another bowl, mix the wet ingredients: melted coconut oil, brown sugar, granulated sugar, eggs, molasses, unsweetened applesauce, and vanilla extract until fully combined.
Gradually add the dry ingredients to the wet ingredients and mix gently until just combined. Fold in chopped walnuts or pecans if desired.
Pour the batter into the prepared baking pan and spread evenly.
Bake for 30-35 minutes, checking for doneness with a toothpick.
Allow the cake to cool in the pan for about 10 minutes before transferring to a wire rack to cool completely.