Redirect to https and redirect all requests to unavailable services to custom error page

I want to redirect all requests to https and in addition catch all requests to an unavailable service and redirect them to a custom error page (similar to Using #traefik error pages to handle unavailable services · Nicholas Dille) but I just can't get both to work.
When both are enabled, only the redirect to https works but then the regular 404 is returned for a service that does not exist.
If I disable the redirect to https, the error redirect works as expected.
This is my current setup:

traefik.toml

[providers]
  [providers.docker]
    watch = true
    network = "public"

[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.http.redirections]
      [entryPoints.http.http.redirections.entryPoint]
        to = "https"
        scheme = "https"
  [entryPoints.https]
  address = ":443"

[api]
  dashboard = true
  insecure = true

docker-compose.yml

version: '3'

services:
  reverse-proxy:
    # The official v2 Traefik docker image
    build:
      context: ./traefik
      dockerfile: Dockerfile
    networks:
      - public
    ports:
      # The HTTP port
      - "80:80"
      - "443:443"
      # The Web UI (enabled by --api.insecure=true)
      - "8080:8080"
    volumes:
      # So that Traefik can listen to the Docker events
      - /var/run/docker.sock:/var/run/docker.sock
      - config:/etc/traefik/config/

  error:
    image: some-nginx-server/with-error-pages
    networks:
      public:
    labels:
      traefik.http.middlewares.traefik-errors.errors.status: 404,500,501,503,504
      traefik.http.middlewares.traefik-errors.errors.service: catch-all
      traefik.http.middlewares.traefik-errors.errors.query: /{status}.html
      traefik.http.routers.catch-all.rule: HostRegexp(`{host:.+}`)
      traefik.http.services.catch-all.loadbalancer.server.port: 80
      traefik.http.routers.catch-all.priority: 1
      traefik.enable: "true"



networks:
  public:

volumes:
  config:

You can do the redirect on entrypoint. See simple Traefik example (link).

Make sure to assign the error middlewares to the services you want it to use (doc).

The first link, as far as I understand it, does exactly what I am doing in my posted traefik configuration. The second answer unfortunately misses the point of my question. I don't want to redirect the response of a specific service to my error middleware (I allready know how to do that and it works fine). I want to redirect requests to non existent services (e.g. when a service is restarting) similar to this: Using #traefik error pages to handle unavailable services · Nicholas Dille
as I mentioned this already works if I disable the https redirection but I want it to work on top of the https redirection.

Have you tried placing the error middleware on the entrypoint (doc)?

Tried it out yesterday but unfortunately leads to the same issue :confused: