version: "3.9" x-traefik-exporter-label: &traefik-exporter-label traefik.enable: true traefik.http.routers.nginx-exporter.service: nginx-exporter traefik.http.services.nginx-exporter.loadbalancer.server.port: 9113 services: nginx: image: nginx:1.27.0-alpine container_name: nginx privileged: true user: root volumes: - /volume5/storage/docker-data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf - /volume5/storage/docker-data/nginx/conf/conf.d/:/etc/nginx/conf.d/ - /volume5/storage/docker-data/nginx/conf/cert/:/etc/nginx/cert/ - /volume5/storage/docker-data/nginx/conf/static/:/usr/share/nginx/static/ restart: always nginx-exporter: image: nginx/nginx-prometheus-exporter:1.3.0 container_name: nginx-exporter labels: <<: *traefik-exporter-label expose: - "9113" command: -nginx.scrape-uri=http://nginx:8080/stub_status restart: always