How to proxy https://<domain>.com to http://<domain>.com/dns-query using docker labels?

Hey I'm using docker with docker-compose and with the labels.

I've used traefik labels before, but I'm a little stumped how to do this using the docker labels.

I'm trying to create a reverse proxy:
https://<domain>.com --> http://<domain>.com/dns-server.

I don't know how to do this with docker labels since I can't specify a server url as I would if I were writing from a static configuration. I don't know if I need to use an add-prefix or redirectregex to make this happen with docker labels.

Here's what I'm working with:

    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=net"
      - "traefik.http.routers.technitium.rule=Host(`ns1.<domain>.com`) || Host (`play.<domain>.com`) || Host(`ubuntu-do.gohilton.com`)"
      - "traefik.http.routers.technitium.entrypoints=web,websecure"
      - "traefik.http.routers.technitium.tls=true"
      - "traefik.http.routers.technitium.tls.options=modern@file"
      - "traefik.http.routers.technitium.tls.certresolver=le"
      - "traefik.http.routers.technitium.tls.domains[0].main=ns1.<domain>.com"
      - "traefik.http.routers.technitium.tls.domains[0].sans=ns1.<domain>.com"
      - "traefik.http.routers.technitium.tls.domains[1].sans=play.<domain>.com"
      - "traefik.http.routers.technitium.tls.domains[2].sans=ubuntu-do.<domain>.com"
      - "traefik.http.routers.technitium.middlewares=mw_technitium_redirect"
      - "traefik.http.middlewares.mw_technitium_redirect.redirectregex.regex=^/$$"
      - "traefik.http.middlewares.mw_technitium_redirect.redirectregex.replacement=/dns-query"
      #- "traefik.http.middlewares.mw_technitium_add_dns-query_prefix.addprefix.prefix=dns-query/"
      - "traefik.http.routers.technitium.service=technitium"
      - "traefik.http.services.technitium.loadbalancer.server.port=8053"
      - "traefik.http.services.technitium.loadbalancer.server.scheme=http"

If you want to specify an external target to proxy/forward requests to, you need to use a dynamic config file.

Check simple Traefik external example.

Note that a "redirect" sends a http redirect status back to the client/browser to tell it to use a different URL.

@bluepuma77

I did not know the redirect set a status back to the browser. That isn't what I want. Thanks for clarification.