# Bypass response codes?

**URL:** <https://community.traefik.io/t/bypass-response-codes/28764>\
**Category:** Traefik v3 (latest)\
**Tags:** docker\
**Created:** [September 29, 2025, 2:48pm UTC](https://community.traefik.io/t/bypass-response-codes/28764 "2025-09-29T14:48:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cfaysal](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cfaysal/32/10521_2.png) [@cfaysal](https://community.traefik.io/u/cfaysal)\
**Post date:** [September 29, 2025, 2:48pm UTC](https://community.traefik.io/t/bypass-response-codes/28764/1 "2025-09-29T14:48:28Z")

</div>

Hi Folks,

here is my situation:

i migrated nexus from a nginx setup to a traefik environment.

old urls contain /nexus

new urls should not have a context path.

i managed to write redirection rules that forward all requests to url with context path to the new one without.

Browser requests work without any issue (using GET header)

but any upload requests (i.e. maven) are not allowed to follow redirects when POST header is used.

is it possible to make traefik respond with 200 instead 302 (permanently redirected) i.e. like a silent redirect ?

thanks in advance

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [September 29, 2025, 7:17pm UTC](https://community.traefik.io/t/bypass-response-codes/28764/2 "2025-09-29T19:17:37Z")

</div>

Share your full Traefik static and dynamic config, and Docker compose file(s) if used.

---

<div class="post-metadata">

**Author:** ![cfaysal](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/cfaysal/32/10521_2.png) [@cfaysal](https://community.traefik.io/u/cfaysal)\
**Post date:** [September 29, 2025, 9:57pm UTC](https://community.traefik.io/t/bypass-response-codes/28764/3 "2025-09-29T21:57:22Z")

</div>

hi bluepuma77

docker-compose.yml

```auto
services:
  traefik:
    image: traefik:latest
    container_name: traefik
    restart: always
    entrypoint:
      - /bin/sh
      - -c
      - |
        cp /certs/suva-root-ca.crt /usr/local/share/ca-certificates/ && \
        update-ca-certificates && \
        exec traefik --configFile=/etc/traefik/traefik.yml
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - ./traefik.yml:/etc/traefik/traefik.yml:ro
      - ./dynamic.yml:/etc/traefik/dynamic.yml:ro
      - ./certs/acme.json:/acme/acme.json
      - ./certs/suva-root-ca.crt:/certs/suva-root-ca.crt:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - traefik
    environment:
      - NO_PROXY=localhost,127.0.0.1,suvanet.ch,.suvanet.ch
networks:
  traefik:
    external: true

```

dynamic.yml

```auto
http:
  middlewares:
    redirect-to-https:
      redirectScheme:
        scheme: https
        permanent: true

  routers:
    http-catchall:
      rule: "HostRegexp(`{host:.+}`)"
      entryPoints:
        - web
      middlewares:
        - redirect-to-https
      service: noop@internal

```

traefik.yml

```auto
global:
  checkNewVersion: false

api:
  insecure: true
  dashboard: true
  debug: true

log:
  level: DEBUG

entryPoints:
  web:
    address: ":80"
  websecure:
    address: ":443"

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

  file:
    filename: /etc/traefik/dynamic.yml
    watch: true

certificatesResolvers:
  custom-acme:
    acme:
      email: "GO-SAFe-Unity@suva.ch"
      storage: /acme/acme.json
      caServer: "https://pkiacme.suvanet.ch:21443/acme/ws/Acme.svc/webserver/directory"
      httpChallenge:
        entryPoint: "web"

```

---

<div class="post-metadata">

**Author:** ![bluepuma77](https://avatars.discourse-cdn.com/v4/letter/b/a9adbd/32.png) [@bluepuma77](https://community.traefik.io/u/bluepuma77)\
**Post date:** [September 30, 2025, 4:33am UTC](https://community.traefik.io/t/bypass-response-codes/28764/4 "2025-09-30T04:33:53Z")

</div>

Regarding wording: a "redirect" is sent by the server to the client, telling it to use a different URL. This can not be done silently. Are you talking about proxying/forwarding the request?

You didn’t Post dynamic config of the service with the problem. I assume you use `stripPrefix` middleware. The challenge is that some services insist on their path, and they will always respond with a redirect, unless you can configure them with some kind of new base path.

Personally I would just leave the context path in place if everything works, instead of hour-long re-configuration.

Note that you overwrite the Docker `entrypoint`, which might have unintended side effects. Signals may not be forwarded, Traefik might not close ports for new connections during shutdown, and you may lose requests during upgrades despite a HA setup.
