Docker/Traefik - Browser Not Supported

I’ve been working on using docker more in my workflow. I wanted to start incorporating Traefik into my containers that I have been using instead of utilizing unique IP addresses. Earlier I got the following code working but when I go to any valid URL like http://localhost/ignition/app/home on edge or Firefox I get “Browser Not Supported” even though I can open the link if I use http://localhost:8088/app/home just fine.

Has anyone else run into this yet?

services:
  traefik:
    image: traefik:v2.10
    container_name: traefik
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080"  # Traefik dashboard
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - traefik-net

  ignition:
    image: inductiveautomation/ignition:8.3
    container_name: ignition
    ports:
      - "8088:8088" # Gateway web interface
      - "8043:8043" # Gateway SSL
    environment:
      - ACCEPT_IGNITION_EULA=Y
      - GATEWAY_ADMIN_USERNAME=admin
      - GATEWAY_ADMIN_PASSWORD=password
      - IGNITION_EDITION=standard
    volumes:
      - ignition-data:/usr/local/bin/ignition/data
    labels:
      - "traefik.enable=true"
      # 1. Match all paths starting with /ignition
      - "traefik.http.routers.ignition.rule=PathPrefix(`/ignition`)"
      - "traefik.http.routers.ignition.entrypoints=web"
      - "traefik.http.services.ignition.loadbalancer.server.port=8088"
      # 2. Define the middleware to strip the prefix
      - "traefik.http.middlewares.ignition-stripprefix.stripprefix.prefixes=/ignition"
      # 3. APPLY the middleware to the router
      - "traefik.http.routers.ignition.middlewares=ignition-stripprefix"
    networks:
      - traefik-net

networks:
  traefik-net:
    driver: bridge

volumes:
  ignition-data:

This is being caused by how the path prefix interacts with Ignition. When you access http://localhost/ignition/app/home, the initial page loads fine, but then Ignition tries to load resources like /system/style.css without the /ignition prefix. Those requests fail (404s) since they don't match your Traefik rule, which is why you're seeing "Browser Not Supported."

Subdomain routing is a better solution for this. Here's what that would look like for your setup:

services:
  traefik:
    image: traefik:v2.10
    container_name: traefik
    command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080"  # Traefik dashboard
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - traefik-net

  ignition:
    image: inductiveautomation/ignition:8.3
    container_name: ignition
    environment:
      - ACCEPT_IGNITION_EULA=Y
      - GATEWAY_ADMIN_USERNAME=admin
      - GATEWAY_ADMIN_PASSWORD=password
      - IGNITION_EDITION=standard
    volumes:
      - ignition-data:/usr/local/bin/ignition/data
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.ignition.rule=Host(`ignition.localtest.me`)"
      - "traefik.http.routers.ignition.entrypoints=web"
      - "traefik.http.services.ignition.loadbalancer.server.port=8088"
    networks:
      - traefik-net

networks:
  traefik-net:
    driver: bridge

volumes:
  ignition-data:

You can access the Ignition service at http://ignition.localtest.me. The *.localtest.me domain automatically resolves to 127.0.0.1, so no need to mess with your hosts file. You can also drop the exposed ports from the Ignition service since Traefik handles all the routing.

4 Likes

Thanks Eric, that fixed it.

1 Like