Skip to content

Commit

Permalink
traefik improvements for SSL Labs A+ results
Browse files Browse the repository at this point in the history
  • Loading branch information
migasQ committed Jun 21, 2023
1 parent eaa816c commit 0f8b740
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ services:
- ./www:/var/www/html
- ${MOODLE_DATA}:/var/www/moodledata
labels:
- traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- traefik.enable=true
- traefik.http.routers.moodle-http.rule=Host(`${MOODLE_URL}`)
- traefik.http.routers.moodle-http.entrypoints=http
- traefik.http.routers.moodle-http.middlewares=https-redirect
- traefik.http.routers.moodle-http.middlewares=https-redirect@file, hsts-header@file
- traefik.http.routers.moodle-https.rule=Host(`${MOODLE_URL}`)
- traefik.http.routers.moodle-https.entrypoints=https
- traefik.http.routers.moodle-https.middlewares=hsts-header@file
- traefik.http.routers.moodle-https.tls=true
- traefik.http.routers.moodle-https.tls.certresolver=le
- traefik.http.services.moodle.loadbalancer.server.port=8080
- traefik.http.services.moodle.loadbalancer.server.port=8080
logging:
driver: local
options:
Expand Down Expand Up @@ -67,6 +66,7 @@ services:
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik:/configuration
- traefik-public-certificates:/certificates
command:
- --providers.docker
Expand All @@ -76,6 +76,8 @@ services:
- --certificatesresolvers.le.acme.email=$HOSTING_EMAIL
- --certificatesresolvers.le.acme.storage=/certificates/acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
- --providers.file.directory=/configuration
- --providers.file.watch=true
- --log
- --log.level=ERROR
restart: always
Expand Down
25 changes: 25 additions & 0 deletions traefik/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[http.middlewares]

[http.middlewares.https-redirect.redirectScheme]
scheme = "https"

[http.middlewares.hsts-header.headers]
[http.middlewares.hsts-header.headers.customResponseHeaders]
Strict-Transport-Security = "max-age=63072000"

[tls.options]

[tls.options.default]
minVersion = "VersionTLS12"
cipherSuites = [
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305",
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305"
]

[tls.options.mintls13]
minVersion = "VersionTLS13"

0 comments on commit 0f8b740

Please sign in to comment.