Repository: traefik/traefik (language: go)

Issue:
There isn't possible to define datacenter when I'm using the new Nomad Service Discovery
### 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 use the new Nomad Service Discovery. I'm trying to define a custom `datacenter` ([following the documentation](https://doc.traefik.io/traefik/v2.8/providers/nomad/#datacenter)):

```bash
docker run -it --rm traefik:v2.8.0-rc1  \
  --api=true  \
  --api.dashboard=true  \
  --api.insecure=true  \
  --entrypoints.web.address=:8000  \
  --entrypoints.web-secure.address=:8443  \
  --log.level=DEBUG  \
  --serversTransport.insecureSkipVerify=true  \
  --providers.docker=true  \
  --providers.docker.swarmMode=false  \
  --providers.docker.exposedByDefault=false  \
  --providers.nomad=true  \
  --providers.nomad.endpoint.address=http://192.168.100.35:4646  \
  --providers.nomad.endpoint.datacenter=dc1 \
  --providers.nomad.endpoint.token=token  \
  --providers.nomad.exposedByDefault=false
```

### What did you see instead?

The following error appears:

```
2022/06/17 19:27:57 command traefik error: failed to decode configuration from flags: field not found, node: datacenter
```

### What version of Traefik are you using?

v2.8.0-rc1

### What is your environment & configuration?

All configurations are defined using `CLI`

### If applicable, please paste the log output in DEBUG level

_No response_


Discussion / hints:
Hello @SrMouraSilva,

Thanks for pointing this out,

This is an unfortunate copy/paste from the consul catalog provider. We will open a pull request to fix that.

Fix patch:
diff --git a/docs/content/providers/nomad.md b/docs/content/providers/nomad.md
index f9d009f9ee..92ce542adf 100644
--- a/docs/content/providers/nomad.md
+++ b/docs/content/providers/nomad.md
@@ -158,33 +158,6 @@ providers:
 # ...
 ```
 
-#### `datacenter`
-
-_Optional, Default=""_
-
-Defines the datacenter to use.
-If not provided in Traefik, Nomad uses the agent datacenter.
-
-```yaml tab="File (YAML)"
-providers:
-  nomad:
-    endpoint:
-      datacenter: dc1
-    # ...
-```
-
-```toml tab="File (TOML)"
-[providers.nomad]
-  [providers.nomad.endpoint]
-    datacenter = "dc1"
-    # ...
-```
-
-```bash tab="CLI"
---providers.nomad.endpoint.datacenter=dc1
-# ...
-```
-
 #### `token`
 
 _Optional, Default=""_
@@ -238,58 +211,6 @@ providers:
 # ...
 ```
 
-#### `httpAuth`
-
-_Optional_
-
-Used to authenticate the HTTP client using HTTP Basic Authentication.
-
-##### `username`
-
-_Optional, Default=""_
-
-Username to use for HTTP Basic Authentication.
-
-```yaml tab="File (YAML)"
-providers:
-  nomad:
-    endpoint:
-      httpAuth:
-        username: admin
-```
-
-```toml tab="File (TOML)"
-[providers.nomad.endpoint.httpAuth]
-  username = "admin"
-```
-
-```bash tab="CLI"
---providers.nomad.endpoint.httpauth.username=admin
-```
-
-##### `password`
-
-_Optional, Default=""_
-
-Password to use for HTTP Basic Authentication.
-
-```yaml tab="File (YAML)"
-providers:
-  nomad:
-    endpoint:
-      httpAuth:
-        password: passw0rd
-```
-
-```toml tab="File (TOML)"
-[providers.nomad.endpoint.httpAuth]
-  password = "passw0rd"
-```
-
-```bash tab="CLI"
---providers.nomad.endpoint.httpauth.password=passw0rd
-```
-
 #### `tls`
 
 _Optional_
diff --git a/pkg/provider/nomad/nomad.go b/pkg/provider/nomad/nomad.go
index c7afa3b1dc..1e2af4510e 100644
--- a/pkg/provider/nomad/nomad.go
+++ b/pkg/provider/nomad/nomad.go
@@ -164,9 +164,10 @@ func (p *Provider) loadConfiguration(ctx context.Context, configurationC chan<-
 func createClient(namespace string, endpoint *EndpointConfig) (*api.Client, error) {
 	config := api.Config{
 		Address:   endpoint.Address,
+		Namespace: namespace,
 		Region:    endpoint.Region,
+		SecretID:  endpoint.Token,
 		WaitTime:  time.Duration(endpoint.EndpointWaitTime),
-		Namespace: namespace,
 	}
 
 	if endpoint.TLS != nil {


Test patch: