Heat the olive oil in a large pot over medium heat. Add the onions and garlic and cook, stirring occasionally, until the onions are golden brown and caramelized, about 20 minutes.
Add the beef broth, thyme, and bay leaf and bring to a boil. Reduce the heat and simmer for 10 minutes.
Melt the butter in a small saucepan over medium heat. Add the flour and cook, stirring constantly, for 2 minutes. Slowly add the cheese and stir until melted and smooth. Add the cheese sauce to the soup and stir to combine.
Add the wine, salt, and pepper and simmer for 5 minutes more.
Ladle the soup into bowls and top each with a slice of toasted French bread. Serve immediately.
Interesting Facts
This soup is a classic French dish, dating back to the 18th century.
Gruyère cheese is traditionally used in French onion soup, but you can also use Swiss cheese or Emmental.
Adding a bit of white wine to the soup will give it a more complex flavor.