{"id":10398,"date":"2026-09-13T07:20:00","date_gmt":"2026-09-13T05:20:00","guid":{"rendered":"https:\/\/www.lukaswojcik.com\/blog\/?p=10398"},"modified":"2026-10-26T11:49:48","modified_gmt":"2026-10-26T10:49:48","slug":"traefik-labels-in-detail-including-the-dollar-trap","status":"publish","type":"post","link":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/","title":{"rendered":"Traefik Labels in Detail, Including the Dollar Trap"},"content":{"rendered":"<p>Docker labels describe several connected Traefik objects. An HTTP router selects requests by a rule, a service defines the destination, and middleware processes requests or responses. References connect these objects; identical names alone do not create a link.<\/p>\n<p>Troubleshooting needs three separate views: the Compose file before substitution, the labels actually stored on the container, and the resulting Traefik configuration. Errors can occur during decoding; a typo is not necessarily silent.<\/p>\n<figure class=\"lw-diagram\"><img decoding=\"async\" src=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/diagrams\/dia-10398-traefiklabels-20261024.png\" width=\"1120\" height=\"580\" loading=\"lazy\" alt=\"TRAEFIK LABELS: REFERENCES AND INTERPOLATION\"><figcaption>$2y and $05 are not unbraced Compose variable names.<\/figcaption><\/figure>\n<h2>Explicit connections between router, service and middleware<\/h2>\n<p>This fragment belongs under an application service in Compose. It assumes a configured Docker provider, the <code>websecure<\/code> entrypoint, the <code>le<\/code> resolver and a shared Docker network actually named <code>proxy<\/code>. The Docker provider reads routing configuration from container labels. An entrypoint defines where Traefik accepts connections; the certificate resolver obtains TLS certificates. The application must be reachable on internal port 8080. The user file must be mounted readably at the specified path inside the <strong>Traefik container<\/strong>; the fragment is not a complete installation.<\/p>\n<figure style=\"--cbb-digits:2\" class=\"cbb cbb--wrap cbb--numbers wp-block-code-beautifier-block-code\" data-lang=\"plain\"><figcaption class=\"cbb-head\"><span class=\"cbb-lang\">Text<\/span><span class=\"cbb-actions\"><button type=\"button\" class=\"cbb-button cbb-button--wrap\" data-cbb-action=\"wrap\" aria-pressed=\"true\" title=\"Wrap long lines\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><path d=\"M2 4h12M2 8h9.5a2.5 2.5 0 0 1 0 5H8m0 0 1.5-1.5M8 13l1.5 1.5M2 12h3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg><span class=\"cbb-sr\">Wrap long lines<\/span><\/button><button type=\"button\" class=\"cbb-button cbb-button--copy\" data-cbb-action=\"copy\" data-cbb-done=\"Copied\" data-cbb-failed=\"Press Ctrl+C to copy\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><rect x=\"5.5\" y=\"5.5\" width=\"8\" height=\"8.5\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><path d=\"M10.5 3.5V3A1.5 1.5 0 0 0 9 1.5H4A1.5 1.5 0 0 0 2.5 3v6.5A1.5 1.5 0 0 0 4 11h.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><\/svg><span class=\"cbb-button-label\" aria-live=\"polite\">Copy<\/span><\/button><\/span><\/figcaption><pre class=\"cbb-pre\" tabindex=\"0\"><code class=\"cbb-code language-plain\" style=\"counter-reset:cbb-line 0;\"><span class=\"cbb-line\">labels:\n<\/span><span class=\"cbb-line\">  - \"traefik.enable=true\"\n<\/span><span class=\"cbb-line\">  - \"traefik.docker.network=proxy\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.routers.blog.rule=Host(`blog.example.com`)\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.routers.blog.entrypoints=websecure\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.routers.blog.tls=true\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.routers.blog.tls.certresolver=le\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.routers.blog.service=blog-service\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.routers.blog.middlewares=blog-auth@docker\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.middlewares.blog-auth.basicauth.usersfile=\/etc\/traefik\/auth\/blog.htpasswd\"\n<\/span><span class=\"cbb-line\">  - \"traefik.http.services.blog-service.loadbalancer.server.port=8080\"<\/span><\/code><\/pre><\/figure>\n<p><code>blog<\/code>, <code>blog-service<\/code> and <code>blog-auth<\/code> deliberately use different names. The router&#8217;s service and middleware fields establish the references. A typo in a freely chosen object name can declare another object, whereas a typo in a defined field such as <code>loadbalancer<\/code> can cause a decoding error.<\/p>\n<p>Without an explicit service reference, the Docker provider can assign a single declared service automatically or create a service. Multiple services make that automatic choice ambiguous. A different service name may therefore go unnoticed in the single-service case, while a later explicit reference fails. Names should avoid conflicts throughout the provider, including across Compose projects.<\/p>\n<p>Without an explicit destination port, documented Docker detection uses the sole or lowest exposed port. This is not automatic selection of a published host port and does not prove that the intended application is listening there. An explicit internal port makes the intention clear.<\/p>\n<h2>Provider names and effective protection<\/h2>\n<p>An unqualified middleware name resolves within the router&#8217;s provider. <code>blog-auth@docker<\/code> states that namespace explicitly; <code>blog-auth@file<\/code> references middleware from an enabled file provider. A missing referenced object prevents that route from being built. This is not a host-wide security guarantee: another matching router may still accept the request.<\/p>\n<p>Declaring middleware does not automatically protect every path to a service. Router chains and any entrypoint default middlewares determine the effective chain. An empty router middleware list therefore does not necessarily mean no protection; conversely, another hostname, entrypoint or directly published backend port can bypass expected protection. BasicAuth needs HTTPS to protect credentials in transit.<\/p>\n<h2>What Compose actually does with dollar signs<\/h2>\n<p>Substituting a variable means replacing its name with its configured value; this is called interpolation. Compose substitutes valid variable expressions such as <code>$NAME<\/code> and <code>${NAME}<\/code>. An unbraced variable name starts with a letter or underscore. The bcrypt prefixes <code>$2y<\/code> and <code>$05<\/code> are therefore not removed as those variables. A later hash segment such as <code>$e6zX...<\/code> can nevertheless start a variable expression; an unset variable normally produces a warning and an empty replacement. The original hash is then no longer reliably preserved.<\/p>\n<p>For a hash written directly into an interpolated Compose label, Traefik recommends escaping every <code>$<\/code> as <code>$$<\/code>. This Bash command prompts for a password and doubles dollar signs in the generated user line:<\/p>\n<figure style=\"--cbb-digits:1\" class=\"cbb cbb--wrap wp-block-code-beautifier-block-code\" data-lang=\"bash\"><figcaption class=\"cbb-head\"><span class=\"cbb-lang\">Shell<\/span><span class=\"cbb-actions\"><button type=\"button\" class=\"cbb-button cbb-button--wrap\" data-cbb-action=\"wrap\" aria-pressed=\"true\" title=\"Wrap long lines\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><path d=\"M2 4h12M2 8h9.5a2.5 2.5 0 0 1 0 5H8m0 0 1.5-1.5M8 13l1.5 1.5M2 12h3\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/><\/svg><span class=\"cbb-sr\">Wrap long lines<\/span><\/button><button type=\"button\" class=\"cbb-button cbb-button--copy\" data-cbb-action=\"copy\" data-cbb-done=\"Copied\" data-cbb-failed=\"Press Ctrl+C to copy\"><svg aria-hidden=\"true\" focusable=\"false\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\"><rect x=\"5.5\" y=\"5.5\" width=\"8\" height=\"8.5\" rx=\"1.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><path d=\"M10.5 3.5V3A1.5 1.5 0 0 0 9 1.5H4A1.5 1.5 0 0 0 2.5 3v6.5A1.5 1.5 0 0 0 4 11h.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\"\/><\/svg><span class=\"cbb-button-label\" aria-live=\"polite\">Copy<\/span><\/button><\/span><\/figcaption><pre class=\"cbb-pre\" tabindex=\"0\"><code class=\"cbb-code language-bash\" style=\"counter-reset:cbb-line 0;\"><span class=\"cbb-line\"><span class=\"cbb-keyword\">set<\/span> <span class=\"cbb-attr\">-o<\/span> pipefail\n<\/span><span class=\"cbb-line\">htpasswd <span class=\"cbb-attr\">-nB<\/span> admin <span class=\"cbb-operator\">|<\/span> <span class=\"cbb-function\">sed<\/span> <span class=\"cbb-string\">'s\/\\$\/$$\/g'<\/span><\/span><\/code><\/pre><\/figure>\n<p>The complete output belongs after <code>basicauth.users=<\/code> when using that option instead of <code>usersfile<\/code>. Ellipses in explanatory hash fragments are not a valid replacement for a complete hash. Supplying a password as an <code>htpasswd -b<\/code> argument can expose it through process listings or shell history; the interactive variant avoids that argument.<\/p>\n<p>Doubling is a Compose-processing rule, not a Traefik rule. An unchanged mounted user file and a directly read Traefik dynamic configuration file contain single dollar signs. Command lines also require attention to the shell; POSIX-shell single quotes protect a literal hash from variable expansion. <code>.env<\/code> files have their own quoting rules. Moving a value between these locations therefore requires another check.<\/p>\n<h2>Diagnosis without guaranteed status codes<\/h2>\n<table><thead><tr><th>Finding<\/th><th>Useful check<\/th><\/tr><\/thead><tbody>\n<tr><td>Missing service or middleware<\/td><td>Check provider, reference and router errors. Without another matching route, 404 is typical; other routers or upstream systems may respond differently.<\/td><\/tr>\n<tr><td>Changed or invalid hash<\/td><td>Check Compose warnings, effective value and authentication errors. A 401 is possible, but does not uniquely establish interpolation.<\/td><\/tr>\n<tr><td>Unreachable backend<\/td><td>Check network, internal IP, port, listener and timeouts. A 502\/504 is a typical clue, not a complete diagnosis.<\/td><\/tr>\n<tr><td>Container not enabled<\/td><td>With <code>exposedByDefault=false<\/code>, check <code>traefik.enable=true<\/code> and other provider conditions.<\/td><\/tr>\n<tr><td>Identical object names with different definitions<\/td><td>Inspect provider-wide name conflicts and logs; Compose project naming does not reliably resolve label-object conflicts.<\/td><\/tr><\/tbody><\/table>\n<p><code>docker compose config<\/code> shows resolved configuration without starting containers. <code>docker inspect<\/code> shows stored labels and networks of an existing container. Comparison needs the complete hash, not just its length; both outputs can contain sensitive values. Traefik logs and effective router\/service objects then show what was accepted. A dashboard view does not replace authentication tests across all access paths.<\/p>\n<div class=\"lw-faq\"><h2>Questions and answers<\/h2>\n<h3>Does usersFile refer to the same file inside the application container?<\/h3><p>No. Traefik reads the file from its own runtime environment. Mounting it only into the application is insufficient. Read permissions and a read-only mount need checking. Combining <code>users<\/code> and <code>usersFile<\/code> merges both lists; precedence for duplicate names should be checked against the deployed Traefik version.<\/p>\n<h3>Which network name does the label expect?<\/h3><p><code>traefik.docker.network<\/code> expects the actual Docker network name. Compose may prefix it with a project name; an explicit <code>name<\/code> or external network can differ. The label selects an existing network and does not attach containers to it.<\/p>\n<h3>How can the dashboard help?<\/h3><p>Through a protected, controlled access path with suitable authentication and TLS. Publicly exposed <code>api.insecure<\/code> is not an appropriate shortcut. Missing routes, authentication failures and backend errors each need configuration, log and request checks.<\/p><\/div><div class=\"lw-quellen\"><h2>Sources<\/h2><ul><li><a href=\"https:\/\/docs.docker.com\/reference\/compose-file\/interpolation\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker: Compose interpolation<\/a><\/li><li><a href=\"https:\/\/doc.traefik.io\/traefik\/reference\/routing-configuration\/other-providers\/docker\/\" target=\"_blank\" rel=\"noopener noreferrer\">Traefik: Docker routing labels<\/a><\/li><li><a href=\"https:\/\/doc.traefik.io\/traefik\/reference\/routing-configuration\/http\/middlewares\/basicauth\/\" target=\"_blank\" rel=\"noopener noreferrer\">Traefik: BasicAuth<\/a><\/li><li><a href=\"https:\/\/doc.traefik.io\/traefik\/reference\/install-configuration\/entrypoints\/\" target=\"_blank\" rel=\"noopener noreferrer\">Traefik: EntryPoint middleware defaults<\/a><\/li><li><a href=\"https:\/\/httpd.apache.org\/docs\/2.4\/programs\/htpasswd.html\" target=\"_blank\" rel=\"noopener noreferrer\">Apache HTTP Server: htpasswd<\/a><\/li><li><a href=\"https:\/\/doc.traefik.io\/traefik\/reference\/install-configuration\/providers\/docker\/\" target=\"_blank\" rel=\"noopener noreferrer\">Traefik: Docker provider<\/a><\/li><li><a href=\"https:\/\/doc.traefik.io\/traefik\/reference\/install-configuration\/api-dashboard\/\" target=\"_blank\" rel=\"noopener noreferrer\">Traefik: API and dashboard<\/a><\/li><li><a href=\"https:\/\/raw.githubusercontent.com\/traefik\/traefik\/master\/pkg\/provider\/configuration.go\" target=\"_blank\" rel=\"noopener noreferrer\">Traefik: Provider configuration source<\/a><\/li><li><a href=\"https:\/\/docs.docker.com\/compose\/how-tos\/environment-variables\/variable-interpolation\/\" target=\"_blank\" rel=\"noopener noreferrer\">Docker: Environment variable interpolation<\/a><\/li><li><a href=\"https:\/\/doc.traefik.io\/traefik\/\" target=\"_blank\" rel=\"noopener noreferrer\">Traefik: Documentation<\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>Traefik routers, services and middleware connect through references. Correct Docker labels, Compose dollar escaping and checks of the effective configuration prevent common routing and authentication mistakes.<\/p>\n","protected":false},"author":1,"featured_media":13899,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[91145,91237],"class_list":["post-10398","post","type-post","status-publish","format-standard","hentry","category-it-networks","tag-docker","tag-self-hosting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Traefik Labels in Detail, Including the Dollar Trap | Lukas Wojcik<\/title>\n<meta name=\"description\" content=\"How Traefik router, service and middleware labels find each other by name, why a middleware reference needs its provider suffix, and the dollar trap.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Traefik Labels in Detail, Including the Dollar Trap | Lukas Wojcik\" \/>\n<meta property=\"og:description\" content=\"How Traefik router, service and middleware labels find each other by name, why a middleware reference needs its provider suffix, and the dollar trap.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/\" \/>\n<meta property=\"og:site_name\" content=\"Lukas Wojcik - Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-13T05:20:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-10-26T10:49:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10398-traefik-labels-in-detail-including-t-g.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Lukas Wojcik\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Lukas Wojcik\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/\"},\"author\":{\"name\":\"Lukas Wojcik\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"headline\":\"Traefik Labels in Detail, Including the Dollar Trap\",\"datePublished\":\"2026-09-13T05:20:00+00:00\",\"dateModified\":\"2026-10-26T10:49:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/\"},\"wordCount\":964,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10398-traefik-labels-in-detail-including-t-g.png\",\"keywords\":[\"Docker\",\"Self-Hosting\"],\"articleSection\":[\"IT &amp; Networks\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/\",\"name\":\"Traefik Labels in Detail, Including the Dollar Trap | Lukas Wojcik\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10398-traefik-labels-in-detail-including-t-g.png\",\"datePublished\":\"2026-09-13T05:20:00+00:00\",\"dateModified\":\"2026-10-26T10:49:48+00:00\",\"description\":\"How Traefik router, service and middleware labels find each other by name, why a middleware reference needs its provider suffix, and the dollar trap.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10398-traefik-labels-in-detail-including-t-g.png\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/hero-10398-traefik-labels-in-detail-including-t-g.png\",\"width\":1200,\"height\":630,\"caption\":\"Traefik Labels in Detail, Including the Dollar Trap\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/en\\\/it-networks\\\/traefik-labels-in-detail-including-the-dollar-trap\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Traefik Labels in Detail, Including the Dollar Trap\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/\",\"name\":\"Lukas Wojcik - Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/#\\\/schema\\\/person\\\/895f7604f9b6b71aad9bba33af28d0f9\",\"name\":\"Lukas Wojcik\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"url\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"contentUrl\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\",\"width\":424,\"height\":636,\"caption\":\"Lukas Wojcik\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/07\\\/lw-x2.jpg\"},\"sameAs\":[\"https:\\\/\\\/www.lukaswojcik.com\\\/blog\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Traefik Labels in Detail, Including the Dollar Trap | Lukas Wojcik","description":"How Traefik router, service and middleware labels find each other by name, why a middleware reference needs its provider suffix, and the dollar trap.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/","og_locale":"en_US","og_type":"article","og_title":"Traefik Labels in Detail, Including the Dollar Trap | Lukas Wojcik","og_description":"How Traefik router, service and middleware labels find each other by name, why a middleware reference needs its provider suffix, and the dollar trap.","og_url":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/","og_site_name":"Lukas Wojcik - Blog","article_published_time":"2026-09-13T05:20:00+00:00","article_modified_time":"2026-10-26T10:49:48+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10398-traefik-labels-in-detail-including-t-g.png","type":"image\/png"}],"author":"Lukas Wojcik","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Lukas Wojcik","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#article","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/"},"author":{"name":"Lukas Wojcik","@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"headline":"Traefik Labels in Detail, Including the Dollar Trap","datePublished":"2026-09-13T05:20:00+00:00","dateModified":"2026-10-26T10:49:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/"},"wordCount":964,"commentCount":0,"publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10398-traefik-labels-in-detail-including-t-g.png","keywords":["Docker","Self-Hosting"],"articleSection":["IT &amp; Networks"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/","url":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/","name":"Traefik Labels in Detail, Including the Dollar Trap | Lukas Wojcik","isPartOf":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#primaryimage"},"image":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#primaryimage"},"thumbnailUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10398-traefik-labels-in-detail-including-t-g.png","datePublished":"2026-09-13T05:20:00+00:00","dateModified":"2026-10-26T10:49:48+00:00","description":"How Traefik router, service and middleware labels find each other by name, why a middleware reference needs its provider suffix, and the dollar trap.","breadcrumb":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#primaryimage","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10398-traefik-labels-in-detail-including-t-g.png","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/09\/hero-10398-traefik-labels-in-detail-including-t-g.png","width":1200,"height":630,"caption":"Traefik Labels in Detail, Including the Dollar Trap"},{"@type":"BreadcrumbList","@id":"https:\/\/www.lukaswojcik.com\/blog\/en\/it-networks\/traefik-labels-in-detail-including-the-dollar-trap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.lukaswojcik.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Traefik Labels in Detail, Including the Dollar Trap"}]},{"@type":"WebSite","@id":"https:\/\/www.lukaswojcik.com\/blog\/#website","url":"https:\/\/www.lukaswojcik.com\/blog\/","name":"Lukas Wojcik - Blog","description":"","publisher":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.lukaswojcik.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.lukaswojcik.com\/blog\/#\/schema\/person\/895f7604f9b6b71aad9bba33af28d0f9","name":"Lukas Wojcik","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","url":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","contentUrl":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg","width":424,"height":636,"caption":"Lukas Wojcik"},"logo":{"@id":"https:\/\/www.lukaswojcik.com\/blog\/wp-content\/uploads\/2026\/07\/lw-x2.jpg"},"sameAs":["https:\/\/www.lukaswojcik.com\/blog"]}]}},"_links":{"self":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/comments?post=10398"}],"version-history":[{"count":7,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10398\/revisions"}],"predecessor-version":[{"id":26682,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/posts\/10398\/revisions\/26682"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media\/13899"}],"wp:attachment":[{"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/media?parent=10398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/categories?post=10398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lukaswojcik.com\/blog\/wp-json\/wp\/v2\/tags?post=10398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}