Repository: traefik/traefik (language: go)

Issue:
Cannot use a plugin that doesn't require configuration
### Welcome!

- [X] Yes, I've searched similar issues on [GitHub](https://github.com/traefik/traefik/issues) and didn't find any.
- [X] Yes, I've searched similar issues on the [Traefik community forum](https://community.traefik.io) and didn't find any.

### What did you do?

I'm trying to load a plugin that doesn't require any configuration

In the traefik configuration file I have to declare something like below to bypass:
```yaml
  middlewares:
    dummy_plugin:
      plugin:
        dummy_plugin:
          key: value
```

### What did you see instead?

With the configuration 
```yaml
  middlewares:
    dummy_plugin:
      plugin:
        dummy_plugin: {}
```

`plugin: missing plugin configuration: dummy_plugin`

### What version of Traefik are you using?

from v2.5 to latest

### What is your environment & configuration?

```yaml
http:
  routers:
    whoami:
      middlewares:
        - dummy_plugin
      entrypoints:
        - http
      service: whoami
      rule: Host(`domain.com`)

  services:
    whoami:
      loadBalancer:
        servers:
          - url: http://whoami
        passHostHeader: false

  middlewares:
    dummy_plugin:
      plugin:
        esi: {}
```

Add more configuration information here.


### If applicable, please paste the log output in DEBUG level

_No response_


Discussion / hints:

Fix patch:
diff --git a/pkg/plugins/middlewares.go b/pkg/plugins/middlewares.go
index 09edbc9543..e46dbae344 100644
--- a/pkg/plugins/middlewares.go
+++ b/pkg/plugins/middlewares.go
@@ -84,6 +84,9 @@ func (p middlewareBuilder) createConfig(config map[string]interface{}) (reflect.
 	}
 
 	vConfig := results[0]
+	if len(config) == 0 {
+		return vConfig, nil
+	}
 
 	cfg := &mapstructure.DecoderConfig{
 		DecodeHook:       mapstructure.StringToSliceHookFunc(","),
diff --git a/pkg/server/middleware/plugins.go b/pkg/server/middleware/plugins.go
index a401791514..3a092f1408 100644
--- a/pkg/server/middleware/plugins.go
+++ b/pkg/server/middleware/plugins.go
@@ -2,7 +2,6 @@ package middleware
 
 import (
 	"errors"
-	"fmt"
 
 	"github.com/traefik/traefik/v2/pkg/config/dynamic"
 	"github.com/traefik/traefik/v2/pkg/plugins"
@@ -30,9 +29,5 @@ func findPluginConfig(rawConfig map[string]dynamic.PluginConf) (string, map[stri
 		return "", nil, errors.New("missing plugin type")
 	}
 
-	if len(rawPluginConfig) == 0 {
-		return "", nil, fmt.Errorf("missing plugin configuration: %s", pluginType)
-	}
-
 	return pluginType, rawPluginConfig, nil
 }


Test patch: