# Override Consul port via tags

**URL:** <https://community.traefik.io/t/override-consul-port-via-tags/4521>\
**Category:** Traefik v2\
**Tags:** consul-catalog\
**Created:** [February 20, 2020, 12:02pm UTC](https://community.traefik.io/t/override-consul-port-via-tags/4521 "2020-02-20T12:02:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![capnjosh](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@capnjosh](https://community.traefik.io/u/capnjosh)\
**Post date:** [February 20, 2020, 12:02pm UTC](https://community.traefik.io/t/override-consul-port-via-tags/4521/1 "2020-02-20T12:02:03Z")

</div>

When I have a service defined in Consul and I'm using the ConsulCatalog provider, I cannot seem to override the port.

If Consul has the port number as 38729, and I have the following tag set on the service:  
"traefik.http.services.myservicename.loadbalancer.server.port=443"

- Traefik still "sees" the 38729 port

I can confirm I can change things about the loadbalancer by adding the following tag:  
"traefik.http.services.v2-services-main-pc-playhawken-com.loadbalancer.server.scheme=https"

- And it has the expected result of changing it to use "https" when routing to the service.

Other posts that seem related:

- [Route magic with consul catalog services](https://community.containo.us/t/route-magic-with-consul-catalog-services/4138)
- [How to specify server in consul catalog？](https://community.containo.us/t/how-to-specify-server-in-consul-catalog/3485)

That second thread seems to indicate Traefik will not override the port, even when the tag is set. I would like to be able to override the port that Traefik routes to.

The other aspect is that if Consul doesn't have a port number specified for a service, I still can't override that via tags. Defining that "....loadbalancer.port=9995" tag results in a port value of "0" showing up in Traefik.

The use case this would support is:

- Have Traefik instances listening on 443, routing via TLS to other Traefik instances listening on a consistent port such as 9995, and those will route only to locally-hosted services. This way I can have edge routers that route to traefik instances that route to services, and all traffic is encrypted, and I can minimize firewall exceptions.

---

<div class="post-metadata">

**Author:** ![ldez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/ldez/32/5_2.png) [@ldez](https://community.traefik.io/u/ldez)\
**Post date:** [February 20, 2020, 3:01pm UTC](https://community.traefik.io/t/override-consul-port-via-tags/4521/2 "2020-02-20T15:01:24Z")

</div>

Hello,

It's a bug, I opened a PR to fix that:

- [https://github.com/containous/traefik/pull/6345](https://github.com/containous/traefik/pull/6345)

---

<div class="post-metadata">

**Author:** ![capnjosh](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@capnjosh](https://community.traefik.io/u/capnjosh)\
**Post date:** [February 21, 2020, 5:35pm UTC](https://community.traefik.io/t/override-consul-port-via-tags/4521/3 "2020-02-21T17:35:24Z")

</div>

Awesome. I pulled your changes and built the binaries for Windows specifically, and everything seems to work. I'm able to override the port to which Traefik sends traffic to backend servers.
