Code Monkey home page Code Monkey logo

Comments (2)

tarampampam avatar tarampampam commented on June 19, 2024

I can't fix this on the error-pages side :( Please, ask for the solution in the https://github.com/traefik/traefik repository

from error-pages.

frugan-dev avatar frugan-dev commented on June 19, 2024

Hi @tarampampam, I have a similar case where I use the basic authentication middleware for accessing the Traefik panel and also with other containers:

labels:
      - traefik.http.middlewares.admin-auth.basicauth.users=${TRAEFIK_USERNAME}:${TRAEFIK_HASHED_PASSWORD}

When one clicks cancel at the login prompt the text message 401 Unauthorized from Traefik appears, not the custom one from error-pages.
Is it possible to fix this?

I'm using Traefik v3.0.1 and this is the part I use with error-pages:

error-pages:
    container_name: error-pages
    image: tarampampam/error-pages:${ERROR_PAGES_TAG:-latest}
    depends_on:
      - traefik
    networks:
      - traefik-public
    environment:
      LISTEN_PORT: ${ERROR_PAGES_LISTEN_PORT}
      TEMPLATE_NAME: ${ERROR_PAGES_TEMPLATE_NAME}
      DEFAULT_ERROR_PAGE: ${ERROR_PAGES_DEFAULT_ERROR_PAGE}
      DEFAULT_HTTP_CODE: ${ERROR_PAGES_DEFAULT_HTTP_CODE}
      SHOW_DETAILS: ${ERROR_PAGES_SHOW_DETAILS}
      DISABLE_L10N: ${ERROR_PAGES_DISABLE_L10N}
    labels:
      - traefik.enable=true
      - traefik.docker.network=traefik-public
      - traefik.constraint-label=traefik-public

      - traefik.http.middlewares.error-pages.errors.status=400-599
      - traefik.http.middlewares.error-pages.errors.service=service-error-pages
      - traefik.http.middlewares.error-pages.errors.query=/{status}.html

      - traefik.http.routers.router-error-pages-http.entrypoints=http
      - traefik.http.routers.router-error-pages-http.rule=HostRegexp(`.+`)
      - traefik.http.routers.router-error-pages-http.priority=1
      - traefik.http.routers.router-error-pages-http.middlewares=error-pages

      - traefik.http.routers.router-error-pages-https.entrypoints=https,entrypoint-forwardedHeaders-trustedIPs
      - traefik.http.routers.router-error-pages-https.rule=HostRegexp(`.+`)
      - traefik.http.routers.router-error-pages-https.priority=1
      - traefik.http.routers.router-error-pages-https.tls=true
      - traefik.http.routers.router-error-pages-https.middlewares=error-pages

      - traefik.http.services.service-error-pages.loadbalancer.server.port=${ERROR_PAGES_LISTEN_PORT}

P.S.
Among other things, I would like to point out that in v3.x of Traefik, if I'm not mistaken, they seem to have removed the named regex routers (e.g. HostRegexp(`{host:.+}`) becomes HostRegexp(`.+`)).

from error-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.