nginxnginx-reverse-proxyjwilder-nginx-proxy

nginx-proxy path based routing gives 404 error for application assets


I'm attempting to use the path based routing feature of nginx-proxy/nginx-proxy to host dozzle at http://media.local/dozzle/.

version: "3"

services:
  nginx-proxy:
    image: nginxproxy/nginx-proxy
    ports:
      - "80:80"
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
      - "./nginx/vhost.d:/etc/nginx/vhost.d"

  dozzle:
    container_name: dozzle
    image: amir20/dozzle:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - VIRTUAL_HOST=media.local
      - VIRTUAL_PATH=/dozzle/
      - VIRTUAL_PORT=8080

When I load http://media.local/dozzle/ in chrome, I get a blank page with the dozzle favicon. The chrome dev tools report

/dozzle/:15     GET http://media.local/assets/main-aeb02c57.css net::ERR_ABORTED 404 (Not Found)
/dozzle/:16     GET http://media.local/assets/main-299e3767.js net::ERR_ABORTED 404 (Not Found)

I've tried this with services other than dozzle and the result is the same, so I do not think this is a dozzle-specific issue. How can I get the path based routing to include all of the application assets?


Solution

  • Dozzle creator here. You haven't configured Dozzle correctly. If you want to route all your traffic to a different base, ie. /dozzle/ then you need to provide DOZZLE_BASE env variable. Example here.