parent
d5c571ba79
commit
95b18063be
@ -1,76 +0,0 @@ |
||||
version: '3.8' |
||||
|
||||
services: |
||||
traefik: |
||||
image: "traefik:v2.3.2" |
||||
hostname: "traefik" |
||||
deploy: |
||||
replicas: 1 |
||||
restart_policy: |
||||
condition: on-failure |
||||
delay: 5s |
||||
max_attempts: 5 |
||||
#placement: |
||||
# constraints: |
||||
# - node.hostname == demo2 |
||||
labels: |
||||
- "traefik.enable=false" |
||||
- "traefik.docker.network=proxy" |
||||
- "traefik.http.routers.api.rule=Host(`traefik.example.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))" |
||||
- "traefik.http.routers.api.service=api@internal" |
||||
## Middlewares |
||||
#- "traefik.http.middlewares.auth.basicauth.users=alpha:$$1$$SEjVHN0z$$Apa3.iHJAW2dbAi6OuwDe/" |
||||
- "traefik.http.routers.api.middlewares=security-headers@file,auth" |
||||
# enable https for api/dashboard |
||||
- "traefik.http.routers.api.tls.certresolver=letsencrypt" |
||||
- "traefik.http.routers.api.entrypoints=websecure" |
||||
- "traefik.http.routers.api.tls.domains[0].main=traefik.example.com" |
||||
# tls options from file |
||||
- "traefik.http.routers.api.tls.options=myoptions@file" |
||||
# dummy port |
||||
- "traefik.http.services.dummyservice.loadbalancer.server.port=1111" # In swarm mode, traefik requires a dummy Port |
||||
|
||||
command: |
||||
#- --pilot.token= |
||||
#- --experimental.plugins.my-traefik-plugin-ip2location.modulename=github.com/negasus/traefik-plugin-ip2location |
||||
#- --experimental.plugins.my-traefik-plugin-ip2location.version=v0.1.0 |
||||
- --api=true |
||||
- --api.dashboard=true |
||||
- --providers.file.filename=/etc/traefik/traefik-proxy-config.toml # Using file for reading the dynamic config |
||||
- --providers.file.watch=true |
||||
- --providers.docker=true |
||||
- --providers.docker.endpoint=unix:///var/run/docker.sock |
||||
- --providers.docker.swarmMode=true |
||||
- --providers.docker.exposedbydefault=false |
||||
- --log.level=Info |
||||
- --accesslog=false |
||||
- --entryPoints.web.address=:80 |
||||
- --entrypoints.web.http.redirections.entrypoint.to=websecure |
||||
- --entrypoints.web.http.redirections.entrypoint.scheme=https |
||||
- --entrypoints.web.http.redirections.entrypoint.permanent=true |
||||
- --entryPoints.websecure.address=:443 |
||||
- --certificatesResolvers.letsencrypt.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory |
||||
- --certificatesResolvers.letsencrypt.acme.tlsChallenge=true |
||||
- --certificatesresolvers.letsencrypt.acme.email=youremail@gmail.com |
||||
- --certificatesResolvers.letsencrypt.acme.storage=/letsencrypt/acme.json |
||||
ports: |
||||
- target: 80 |
||||
published: 80 |
||||
mode: host |
||||
|
||||
- target: 443 |
||||
published: 443 |
||||
mode: host |
||||
|
||||
volumes: |
||||
- "/var/run/docker.sock:/var/run/docker.sock" |
||||
- "./letsencrypt:/letsencrypt" |
||||
- "./traefik-proxy-config.toml:/etc/traefik/traefik-proxy-config.toml:ro" |
||||
#- "./basicauth:/basicauth:ro" |
||||
networks: |
||||
proxy: |
||||
|
||||
networks: |
||||
proxy: |
||||
external: true |
||||
name: proxy |
@ -1,41 +0,0 @@ |
||||
################# |
||||
#### MIDDLEWARES |
||||
################# |
||||
[http.middlewares] |
||||
[http.middlewares.security-headers.headers] |
||||
accessControlAllowMethods= ["GET", "OPTIONS", "PUT"] |
||||
#accessControlAllowOrigin = "origin-list-or-null" |
||||
accessControlMaxAge = 100 |
||||
addVaryHeader = true |
||||
#frameDeny = true |
||||
sslRedirect = true |
||||
browserXssFilter = true |
||||
contentTypeNosniff = true |
||||
# |
||||
stsIncludeSubdomains = true |
||||
stsPreload = true |
||||
stsSeconds = 31536000 |
||||
|
||||
##################### |
||||
#### CUSTOM TLS CERT |
||||
##################### |
||||
[tls] |
||||
[tls.options] |
||||
[tls.options.myoptions] |
||||
minVersion = "VersionTLS12" |
||||
curvePreferences = ["CurveP521", "CurveP384"] |
||||
sniStrict = true |
||||
|
||||
cipherSuites = [ |
||||
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", |
||||
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", # tls1.2 |
||||
"TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", |
||||
#"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", # 128 bit |
||||
"TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", |
||||
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", # tls1.2 |
||||
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", |
||||
"TLS_FALLBACK_SCSV", # Client is doing version fallback. See RFC 7507. |
||||
"TLS_AES_256_GCM_SHA384", # tls1.3 |
||||
"TLS_CHACHA20_POLY1305_SHA256" # tls1.3 |
||||
|
||||
] |
Loading…
Reference in new issue