volumes: nginx_conf: services: web1: image: web expose: - "81" environment: WEB_PORTS: "81" VIRTUAL_HOST: "www.nginx-proxy.tld" VIRTUAL_PATH: "/web1/" VIRTUAL_DEST: "/" sut: profiles: - singleContainer image: nginxproxy/nginx-proxy:test volumes: - &dockerSocket /var/run/docker.sock:/tmp/docker.sock:ro - &certs ./certs:/etc/nginx/certs:ro environment: &nginxProxyEnv DEFAULT_ROOT: "301 http://$$host/web1$$request_uri" sut-dockergen: profiles: - separateContainers image: nginxproxy/nginx-proxy:test-dockergen volumes: - &confVolume nginx_conf:/etc/nginx/conf.d - *dockerSocket - *certs environment: *nginxProxyEnv sut-nginx: profiles: - separateContainers container_name: nginx-proxy image: nginx:alpine volumes: - *confVolume - *certs labels: - "com.github.nginx-proxy.nginx-proxy.nginx"