Heat the oil in a large pot over medium heat. Add the onion, carrots, celery, salt, and pepper. Cook until the onion is soft (about 5 minutes).
Add the garlic and fry 1 more minute.
Add the tomatoes and stir, scraping the bottom of the pan. Add beans, herbs, stock, and Parmesan rind. Bring the soup to a boil, reduce heat and simmer for 30 minutes.
If Using frozen spinach, it should be added at this point and mixed in before the pasta. Add broken up spaghetti lower the heat and cook until tender (about minutes) stirring frequently to keep the pasta from sticking to the bottom of the pan.
If using fresh spinach, add the spinach before serving and cook until tender. Discard the cheese rind.