@@ -7,8 +7,15 @@ services:
77 command:
88 - "--api=true"
99 - "--api.dashboard=true"
10+ - "--accesslog=true"
11+ - "--accesslog.format=json"
12+ - "--accesslog.fields.defaultmode=keep"
13+ - "--accesslog.fields.names.ClientUsername=keep"
14+ - "--accesslog.fields.headers.defaultmode=keep"
15+ - "--accesslog.fields.headers.names.User-Agent=keep"
16+ - "--accesslog.fields.headers.names.Authorization=drop"
17+ - "--accesslog.fields.headers.names.Content-Type=keep"
1018 - "--log.level=${OPS_TRAEFIK_LOGLEVEL}"
11- - "--accesslog=false"
1219 - "--metrics.prometheus=true"
1320 - "--metrics.prometheus.addEntryPointsLabels=true"
1421 - "--metrics.prometheus.addServicesLabels=true"
@@ -18,9 +25,9 @@ services:
1825 - "--entryPoints.http.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
1926 - "--entryPoints.http.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2027 - "--entryPoints.http.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
21- - --entrypoints.http.http.redirections.entrypoint.to=https
22- - --entrypoints.http.http.redirections.entrypoint.scheme=https
23- - --entrypoints.http.http.redirections.entrypoint.permanent=true
28+ - " --entrypoints.http.http.redirections.entrypoint.to=https"
29+ - " --entrypoints.http.http.redirections.entrypoint.scheme=https"
30+ - " --entrypoints.http.http.redirections.entrypoint.permanent=true"
2431 - '--entryPoints.postgres.address=:5432'
2532 - '--entryPoints.postgres2.address=:5433'
2633 - "--entryPoints.https.address=:443"
@@ -90,16 +97,12 @@ services:
9097 # via https://community.traefik.io/t/v2-2-8-global-redirect-www-to-non-www-with-http-to-https/7428
9198 # see also: https://community.traefik.io/t/get-a-valid-ssl-certificate-for-www-domains-via-traefik-and-lets-encrypt/2023
9299 # Global redirection: https (www.) to https
93- - traefik.http.routers.wwwsecure-catchall.rule=HostRegexp(`(?P<host>(www\.).+)`)
94- - traefik.http.routers.wwwsecure-catchall.entrypoints=https
95- - traefik.http.routers.wwwsecure-catchall.tls=true
96- - traefik.http.routers.wwwsecure-catchall.middlewares=wwwtohttps
97- # middleware: http(s)://(www.) to https://
98- - traefik.http.middlewares.wwwtohttps.redirectregex.regex=^https?://(?:www\.)?(.+)
99- - traefik.http.middlewares.wwwtohttps.redirectregex.replacement=https://$${1}
100- - traefik.http.middlewares.wwwtohttps.redirectregex.permanent=true
101- # Explicit www domain certificate
102- - traefik.http.routers.wwwsecure-catchall.tls.domains[0].main=www.${MACHINE_FQDN}
100+ - traefik.http.routers.www-catchall.rule=Host(`www.osparc.local`)
101+ - traefik.http.routers.www-catchall.priority=100000
102+ - traefik.http.routers.www-catchall.entrypoints=https,http
103+ - traefik.http.routers.www-catchall.tls=true
104+ - traefik.http.routers.www-catchall.middlewares=strip-www
105+
103106 ###########################
104107 # basic authentication
105108 # Note: all dollar signs in the hash need to be doubled for escaping.
@@ -137,6 +140,12 @@ services:
137140 - traefik.http.middlewares.authenticated_platform_user.forwardauth.address=http://${WEBSERVER_HOST}:${WEBSERVER_PORT}/v0/auth:check
138141 - traefik.http.middlewares.authenticated_platform_user.forwardauth.trustForwardHeader=true
139142 - traefik.http.middlewares.authenticated_platform_user.forwardauth.authResponseHeaders=Set-Cookie,osparc-sc2
143+ #
144+ # middleware: http(s)://(www.) to https://
145+ - traefik.http.middlewares.strip-www.redirectregex.regex=^(https?)://www\.(.+)
146+ - traefik.http.middlewares.strip-www.redirectregex.replacement=$${1}://$${2}
147+ - traefik.http.middlewares.strip-www.redirectregex.permanent=true
148+
140149 networks:
141150 public: null
142151 monitored: null
@@ -145,7 +154,7 @@ services:
145154 deploy:
146155 placement:
147156 constraints:
148- - node.labels.ops ==true
157+ - node.labels.traefik ==true
149158 labels:
150159 - traefik.enable=true
151160 - traefik.docker.network=${PUBLIC_NETWORK}
0 commit comments